WebDriver Entire Setup and Installation with Eclipse – Selenium Tutorial #9

In the previous tutorial, we introduced the basic architecture and features of WebDriver. This is 9th tutorial in Selenium Tutorial Training Series.

In this tutorial, we would be discussing about the installation procedure to get started with WebDriver initiating from the scratch. We would also be discussing about the diverse range of drivers provided by WebDriver, each catering to different testing and environmental needs.

To be able to use WebDriver for scripting, there are some pre-requisites that need to be in place like the basic environment setup. In this series, we would be using Java as a programming language within our sample examples. Thus let us kick start with the Java installation.

Java Installation

Step 1: Go to Oracle official site – “JAVA download”, download Java Platform, Standard Edition. All the recent releases are available on the page.

webdriver installtion with eclipse 1

Step 2: As soon as you click on the Download button, following screen would appear. Accept the License agreement for Java installation and choose amongst the various catalogued Java Development Kit’s. Select the one that best suits your system configuration.

webdriver installtion with eclipse 2

Remember to download JDK (Java development kit). The kit comes with a JRE (Java Runtime environment). Thus the user isn’t required to download and install the JRE separately.

Eclipse IDE Installation

Step 1: Go to Eclipse official website and navigate to its download page – Eclipse download. Download Eclipse IDE for Java EE developers. All the recent releases are available on the page.

Make sure you opt and download the appropriate eclipse IDE as per your system configuration. There are two download links available for 64 bit windows operating system and 32-bit windows operating system.

webdriver installtion with eclipse 3

Step 2: As soon as we click on the download link, the user is re-directed to the fresh page securing information about the current download. Click on the download icon and you are done.

webdriver installtion with eclipse 4

It may take a few minutes before you can download the complete zip folder.

Step 3: Once downloaded, copy the folder and place it in the desired location on your file system.

webdriver installtion with eclipse 5

Step 4: Extract the zipped folder, a folder named as eclipse can be seen. The folder embodies all the required application and source files.

webdriver installtion with eclipse 6

Step 5: Launch the eclipse IDE using “eclipse.exe” residing inside the eclipse folder. Refer the above illustration for the same.

Step 6: The application will prompt you to specify the workspace location. Workspace is that location where all your eclipse projects will be residing. Enter/Browse the desired location or the user can simply opt for the default location and click on the OK button.

webdriver installtion with eclipse 7

Configuring WebDriver

As we would be using Java as the programming language for this series and in order to create test scripts in java, we would have to introduce language- specific client drivers. Thus, let us begin with the downloading of Selenium Java Client Libraries.

Download the Selenium Java Client Libraries

Step 1: Go to Selenium’s official website and navigate to its download page – “http://docs.seleniumhq.org/download/”. Refer the section in the below illustration where you can find Client Libraries listed for distinct programming languages. Click on the download link for Java Client Library.

webdriver installtion with eclipse 8

------------

It may take a few minutes before you can download the complete zipped folder.

Step 2: Once downloaded, copy the folder and place it in the desired location on your file system.

Step 3: Extract the zipped folder, a folder named as “Selenium-2.41.0.zip“can be seen. The folder embodies all the required jar files which enable users to create test scripts in Java.

Thus these libraries can be configured in Eclipse IDE.

Configuring Libraries with Eclipse IDE

Step 1: Navigate towards Eclipse IDE. Create a new java based project following File -> New -> Java Project. Refer the following figure for the same.

webdriver installtion with eclipse 9

Step 2: Provide a user defined name for your Java Project. Let us provide the name as Learning_Selenium and Click on the Finish Button. The newly created project can be viewed at the left side of the screen in the package explorer panel.

Step 3: Create a new Java class named as “First_WebdriverClass” under the source folder by right clicking on it and navigating to New -> class.

Step 4: Now let us configure the libraries into our Java project. For this, select the project and Right click on it. Select “Properties” within the listed options. The following screen appears, Select “Java Build Path” from the options.

webdriver installtion with eclipse 10

Step 5: By default, “Libraries” tab is opened. If not, click on the “Libraries” tab. Then, click on the “Add External Jars…” button. Browse to the location where we have saved the extracted folder for Java Client Libraries.

Step 6: Select all the JAR files present in the “selenium-java-2.41.0” folder and click on open button within the dialog box. The properties dialog box should look like the below illustration.

webdriver installtion with eclipse 11

Step 7: Click on the “OK” button within the dialog box so as to complete the configuration part of Selenium Libraries in our java project.

The project will look like the following:

webdriver installtion with eclipse 12

Available Drivers                                                                                                  

There are a number of driver classes available in WebDriver, each catering a specific web browser. Each browser has a different driver implementation in WebDriver.

In WebDriver, a few of the browsers can be automated directly where as some of the web browsers require an external entity to be able to automate and execute the test script. This external entity is known as Driver Server. Thus, user is required to download the Driver Server for different web browsers.

Notice that there is a separate Driver Server for each of the web browser and user cannot use one Driver Server for web browsers other than the one it is designated for.

Below is the list of available web browsers and their corresponding Server Drivers.

webdriver installtion with eclipse 13

Conclusion

In this tutorial, we accustomed you with all the environment setup and installation to be done prior to creation of WebDriver test scripts.

Here are the cruxes of this article.

  • Prior to the creation of WebDriver based test scripts, few utilities and packages are required to be installed.
  • Install JDK (Java Development Kit). Remember, the user is not supposed to install JRE separately because it is distributed bundled with the kit.
  • Download Eclipse IDE. User is only required to download the package and he/she is good to go. No other installation is required with Eclipse.
  • Download Java Client Libraries to be able to create test script in java programming language.
  • Launch eclipse using eclipse.exe. Select the workspace where you would want to save the projects.
  • Create a new java project in the eclipse. Create a new java class within the project.
  • Configure the eclipse by importing jars files for Java Client Drivers.
  • In WebDriver, a few of the browsers can be automated directly where as some of the web browsers require an external Driver Server.
  • Firefox and HTML Unit are the only browsers that cannot be automated directly. Thus they do not require any separate Driver Server. All other commonly known web browsers like Chrome, Safari, Internet Explorer etc. requires Driver Servers.

Next Tutorial #10 => Now that we are done with the entire setup and installation, in the next tutorial we would create our own WebDriver test script using Java.

A remark for the readers: While our next tutorial of the Selenium tutorials series is in the processing mode, install the packages mentioned in this tutorial and the required utilities to get started. Most of the WebDriver related packages can be found at the Selenium’s official website.

Let us know if you face any issues in installation process.

Recommended reading

46 comments ↓

#1 hitesh

Nice explanation to setup webdriver for Java language.

Could you provide any links or URL details where i could setup webdriver for C# Language.

Your help will be appreciating.
Thanks,
Hitesh

#2 Shruti Shrivastava

@Hitesh

Thank you for the appreciation.
For setting your WebDriver for C#, you can download the client for C# as shown in one of the images of this tutorial (http://cdn.softwaretestinghelp.com/wp-content/qa/uploads/2014/10/webdriver-installtion-with-eclipse-8.jpg).

After downloading client, you can configure it within your Visual Studio.

#3 Shruti Shrivastava

@Hitesh

Thank you for the appreciation.
For installation webDriver with C#, you can download the client specific to C# from Selenium’s official download page. You can refer to one of the images in this tutorial for the same.

Once the download is completed, you can configure the client libraries within your Visual Studio.

#4 Swapnil

@ Shruti…within conclusion section point needs to be corrected as- Firefox and HTML Unit are the only browsers that can be automated directly

#5 Vivek Singh

Appreciable job you people are doing . Keep it up so that learning process become handy for learners.

Thank you.:)

#6 Ankur Tyagi

Hi Team,

I think in conclusion section last point has a mistake..

“Firefox and HTML Unit are the only browsers that “cannot” be automated directly.” Thus they do not require any separate Driver Server. All other commonly known web browsers like Chrome, Safari, Internet Explorer etc. requires Driver Servers.

“Firefox and HTML Unit are the only browsers that can be automated directly.”

Please correct this in the page. as both of them not required external driver so we can directly automate both of them.

Regards
Ankur

#7 Vishal Pate

Hello Shruti,

Nice explanation to setup web-driver for Java language.

Regards,
Vishal Pate

#8 Roshid

Firefox and HTML Unit are the only browsers that “cannot” be automated directly.

#9 Prasad

Hi, I just want to know how to link Selenium documentation in eclipse. I tried using CTRL+ Click option and tried to link but Documentation is not available

#10 Nicklaus

Hi! How about integrating webdriver using idea?

#11 ankur

Hi,

The last sentence (Cruxes) “Firefox and HTML Unit are the only browsers that cannot be automated directly.” seems to be incorrect.

Thanks for such an effort with these tutorials these are really great and written even for a laymen person.

Liked it :)

#12 Durga

thank u sir for your clear Explanation .
here ,you show first jdk installation and then eclipse ok fine. but here how these two s/w interconnected.

i am new to java.i like to learn java.

#13 Gaurav Khurana

@durga

JDK= java development kit, you need this to write programs in java.
Eclipse = it’s an IDE, it makes it easy for you to write programs.

So JDK is necessary for you to run java programs, the eclipse will make your work easy when you write programs.

#14 Arun

really u guys are awesome,…
very responsible in each tutorial

#15 Ammar

Great article thank you very much

#16 Rasana Singh

hi team,

i tried to set up selenium webdriver using eclipse luna 4.4.0, java 1.7 , selenium 2.44.0 jar file and running the script using firefox 32.0.3 . on while running the script it’s giving error – Exception in thread “main” org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port 7055; process output follows:
xtensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}”,”mtime”:1416281870251,”rdfTime”:1411526204000}}},{“name”:”winreg-app-user”,”addons”:{“ocplugin@webex.com”:{“descriptor”:”C:\\Program Files (x86)”,”mtime”:1442838747186},”{9F17B1A2-7317-49ef-BCB7-7BB47BDE10F8}”:{“descriptor”:”C:\\Program Files (x86)\\HP\\Unified Functional Testing\\Bin\\Mozilla\\Common”,”mtime”:1420621650641,”rdfTime”:1394074736000}}},{“name”:”app-profile”,”addons”:{“fxdriver@googlecode.com”:{“descriptor”:”C:\\Users\\rsingh18\\AppData\\Local\\Temp\\anonymous6893853547649188131webdriver-profile\\extensions\\fxdriver@googlecode.com”,”mtime”:1442838830775,”rdfTime”:1442838830564}}}]
1442838865606 addons.xpi-utils DEBUG Opening XPI database C:\Users\rsingh18\AppData\Local\Temp\anonymous6893853547649188131webdriver-profile\extensions.json
1442838865609 addons.xpi DEBUG New add-on fxdriver@googlecode.com installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1442838866450 addons.xpi-utils DEBUG Make addon app-profile:fxdriver@googlecode.com visible

can somebody please help me how to cure this issue ?

#17 Lekha

Hello,
First of all heartiest congratulations and appreciation for doing this commendable job of training students with each and every possible details.
I have a question, I see that your project structure has a “Referenced Libraries” which I believe contains all the External Jars we pulled from selenium-java-2.41.0. But mine are all listed in the project tree itself. I was wondering how can I create one “Referenced Libraries” like you to contain all of them so that it looks much cleaner.

#18 vaibhav

Hi team ,
i think you should include environmental variable setting for jdk.
because some peoples are new to some.
Thanks for the tutorial. :)

#19 Mitul Thesiya

Hello Mr/s Authors,

I’ve read below sentence in tutorial#9 of Webdriver-eclipse-installation-selenium-tutorial series:

Firefox and HTML Unit are the only browsers that cannot be automated directly.

Here… “Cannot be” should be “can be”. Request to review and correct.

#20 Lawrence Francis Xavier

Hi,
while downloading eclipse, am able to download the same successfully, but after unzipping the i couldnt find .exe file for eclipse. Please help me on the same

Thanks & Regards
Lawrence Francis Xavier

#21 Deepak

Thank you so much for above information. As every thing pretty clear and accurate on above provided data, I would like to see some update on data posted above:

Under Conclusion section, One point require a correction. It should notify “Firefox and HTML Unit are the only browsers that can be automated directly” where as “Firefox and HTML Unit are the only browsers that cannot be automated directly.

As many users/reader like me are relying on above tutorial, would like to give my observation. Not Intend to point out data correction.

Thanks Once again for Such a wonderful presentation at each tutorial Guys.

#22 Girish

“Firefox and HTML Unit are the only browsers that cannot be automated directly” does not seems to be apt

#23 Kalai

I think the best & easy way to start learning selenium is to use maven where you can skip all these installations and declare in dependencies. Nowadays most of the IDE’s comes with maven pre-installed.

#24 Amandeep Singh

Another great resource :)

I found an error on the page which you might consider fixing “Firefox and HTML Unit are the only browsers that ‘cannot’ be automated directly.” needs to read “Firefox and HTML Unit are the only browsers that ‘can’ be automated directly.”

#25 Chris Heemskerk

Dear Madam/Sir,

Really good website, the selenium tutorials are very useful. Gives a good start and overview.

Thank you.

#26 praveen

Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: “d”:”C:\\Program Files\\Mozilla Firefox\\browser

when i try to run selenium webdriver program , it opens up and refusing connection as above stated

#27 Ram

Hi Shruti ma’am,

I haven’t knowledge about mobile automation testing, It could be possible u help me to automate mobile application with the help of “Appium”. I have good knowledge about selenium.

Thanx
Ram Vishwakarma

#28 Reuven Dulitzki

Hello,
I have followed up on all steps as mentioned in tutorials 1 to 9.
I made 3 attempts to install everything exactly according to your instructions. However, once executing any new created class, I am getting the following error message:

Exception in thread “main” java.lang.NoClassDefFoundError: com/google/common/base/Function
at Gmail_Login.main(Gmail_Login.java:12)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 1 more

#29 Prasanna

Hello,
I am bit confused regarding eclipse download, I checked the download link provided in this tutorial which directed to the eclipse.org, but, there are several (mirror) links visible after I clicked for 64-bit download.

Kindly help for eclipse download.

Thanks.

#30 pritam

my current system is windows 10.
after adding all the additional jars for selenium webdriver version 3.0.0 beta-2, and wrote the code (i.e. WebDriver driver = new FirefoxDriver();)
and when i executed it it shows some error message ,by underlining the comment ‘driver’
in error message it displayed “remove ‘driver’ and all assignments”
here I have attached the screenshots regarding that problem ,go through the link for better assistance :
https://drive.google.com/folderview?id=0B-ASJfWgGOnzUTU3NmZqXzZOdXc&usp=sharing
please give me a solution .

#31 Ravil

Python installation guide would be so much useful. Almost everyone uses Selenium WebDriver with Python since it is one of the easiest languages for testers to learn. Java is a disaster :/

#32 Rashmi

Hi – Could you please let me know how to install selenium on linux with python.Thanks.

#33 venkat

Hi
i have downloaded java and eclipse luna from web sites and installed successfully and written sample web driver program.when running the java application the below exception showing .please help me

Usage:
D:\Selenium\geckodriver.exe [OPTIONS]
D:\Selenium\geckodriver.exe: Unknown option –port=2236
Oct 30, 2016 8:44:21 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel’s Law holds true on the remote end
Exception in thread “main” org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2236 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
Build info: version: ‘unknown’, revision: ‘1969d75’, time: ‘2016-10-18 09:43:45 -0700’
System info: host: ‘VenkataRao-PC’, ip: ‘192.168.0.11’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_112’
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:91)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:259)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:247)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:242)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:238)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:127)
at com.selinum.Test.BasicTest.main(BasicTest.java:28)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2236 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:158)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:142)
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:88)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:108)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:64)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
… 9 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
… 24 more

#34 sayed ahmed

hi,
you worte…

Step 2: Once downloaded, copy the folder and place it in the desired location on your file system.

but you did not mention where to copy it. i mean give an example.

#35 Shakti Das

Exception in thread “main” java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:37)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:95)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:277)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:247)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:242)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:238)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:127)
at MyClass.main(MyClass.java:12)

#36 Fabi

“Firefox and HTML Unit are the only browsers that cannot be automated directly. Thus they do not require any separate Driver Server. All other commonly known web browsers like Chrome, Safari, Internet Explorer etc. requires Driver Servers.”

– In this paragraph of content is it ” Firefox and HTML Unit are the only browsers that “cannot(can or cannot???)” be automated directly (“http://www.softwaretestinghelp.com/webdriver-eclipse-installation-selenium-tutorial-9/:” )

kindly correct as it is an important point.

#37 Tarun Kumar

hi,
I’m getting below output in console.Please tell me whats is going wrong with the eclipse.

at .DelayedCommand.prototype.execute/<(file:///C:/Users/KUMAAR/AppData/Local/Temp/anonymous8589265385386591257webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12608)

please help me!

#38 Preethi

Thank you for all the good tutorials that you provide.

I have this error and will appreciate your help to resolve this: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
“homepageURL”:null,”contributors”:[“Mozilla Contributors”]},”visible”:true,”active”:true,”userDisabled”:false,”appDisabled”:false,”descriptor”:”C:\\Program Files\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi”,”installDate”:1460086235000,”updateDate”:1460086235000,”applyBackgroundUpdates”:1,”skinnable”:true,”size”:22012,”sourceURI”:null,”releaseNotesURI”:null,”softDisabled”:false,”foreignInstall”:false,”hasBinaryComponents”:false,”strictCompatibility”:true,”locales”:[],”targetApplications”:[{“id”:”{ec8030f7-c20a-464f-9b0e-13a3a9e97384}”,”minVersion”:”45.0.2″,”maxVersion”:”45.0.2″}],”targetPlatforms”:[],”seen”:true}.

Thanks.
Preethi

#39 sowjanyakumar

i have configured selenium and TestNG in Eclipse Neon.2 Release (4.6.2) successfully. Unable to Run HTML UNIT driver.

org.testng.TestNGException:
Cannot instantiate class org.testng.NewTest
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:40)
at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:363)
at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:275)
at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:126)
at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:191)
at org.testng.TestClass.getInstances(TestClass.java:100)
at org.testng.TestClass.initTestClassesAndInstances(TestClass.java:86)
at org.testng.TestClass.init(TestClass.java:78)
at org.testng.TestClass.(TestClass.java:41)
at org.testng.TestRunner.initMethods(TestRunner.java:425)
at org.testng.TestRunner.init(TestRunner.java:252)
at org.testng.TestRunner.init(TestRunner.java:222)
at org.testng.TestRunner.(TestRunner.java:171)
at org.testng.remote.support.RemoteTestNG6_10$1.newTestRunner(RemoteTestNG6_10.java:28)
at org.testng.remote.support.RemoteTestNG6_10$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_10.java:61)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:623)
at org.testng.SuiteRunner.init(SuiteRunner.java:189)
at org.testng.SuiteRunner.(SuiteRunner.java:136)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1375)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1355)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1209)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
… 25 more

#40 sowjanyakumar

How To configure HTML UNIT DRIVER in selenium 3.0.1 and Eclipse

#41 Pratik Shinde

Error is coming
Exception in thread “main” java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:37)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:95)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:277)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:247)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:242)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:238)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:127)
at Gmail_Login.main(Gmail_Login.java:13)

#42 Shiv

Anyone has real time Java interview questions for manual testers?

#43 kirandeep

I am fresher in this field, this tutorial is very helpful for me….thanks a lot

#44 Rahul Tiwari

Hi,

I think there is correction needed in below statement,”Firefox and HTML Unit are the only browsers that cannot be automated directly”

It should be “Firefox and HTML Unit are the only browsers that can be automated directly”

#45 Abhishek Yadav

i am learning this code
i want to open a google using this code
i am using 2.31.0 selenium web driver
jre 1.7
and Firefox Setup 51.0b4

i copied the code from google
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class fd1
{
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
driver.get(“http://www.google.com”);
System.out.println(driver.getTitle());
//driver.close();
}
}

but i run the code
address.getHostName() = 127.0.0.1
address.getHostAddress() = 127.0.0.1
address.isLoopbackAddress() = true
address.getHostName() = 0:0:0:0:0:0:0:1
address.getHostAddress() = 0:0:0:0:0:0:0:1
address.isLoopbackAddress() = true

but firefox not opening…

#46 kishore

Firefox and HTML Unit are the only browsers that cannot be automated directly.

I do not think above statement is correct, written under CRUX section

Leave a Comment