I am trying to launch browser using testng but not able to execute Please help me solving this error

0 votes
public class demo {

@Test

public void openBrowser()

{

System.setProperty("WebDriver.chrome.driver","C://drivers//chromedriver.exe");

// ChromeDriverManager.getInstance().setup();

WebDriver driver=new ChromeDriver();

}

}

The above lines are the code.

This is the error I am facing:

[RemoteTestNG] detected TestNG version 7.3.0
FAILED: openBrowser
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
Aug 24, 2020 in Selenium by chandana
• 120 points
4,434 views

Hello @chandana,

Does Your Driver path set before browser launch as given below.

System.setProperty("webdriver.chrome.driver","D:\List_of_Jar\chromedriver.exe");
WebDriver wd =new ChromeDriver();
String baseUrl = "https://www.EDUREKA.com";
wd.get(baseUrl);"

1 answer to this question.

+1 vote
Please check your chrome version, launch with the same version of chrome exe.
answered Aug 25, 2020 by Pramod
• 160 points

Related Questions In Selenium

+1 vote
0 answers

Hello i have written below code to verify title using POM method but i am not able to print please help me

public static void verifytitle() { String Createanewaccounttttt=driver.getTitle(); System.out.println("Title is"+Createanewaccounttttt); String excepted_title="Create ...READ MORE

Sep 24, 2020 in Selenium by Jordan
• 410 points
779 views
0 votes
1 answer

I am not able to generate extent report with screenshot in selenium cucumber java .. Please help me out

Hello @kanikahans, You need to define Extent Report ...READ MORE

answered Aug 24, 2020 in Selenium by Niroj
• 82,840 points
8,471 views
+1 vote
0 answers
+1 vote
2 answers
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,674 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,143 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,221 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,874 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP