How to setup Selenium WebDriver with TestNG, JUnit, Maven & ReportNG in Eclipse

I have seen this question posted in many forums "How to setup Selenium WebDriver with TestNG" or just "How to setup Selenium WebDriver in Eclipse", and I have also seen many good articles suggesting step by step information on how to setup Selenium 2.0 (WebDriver) with Eclipse but never seen some directly providing Java project with all the details.

I have tried creating one simple setup which includes Eclipse and with Selenium 2.0 WebDriver Java project. Java project has following plug-ins installed, you can use them as per your requirements in your test automation project.

Zip includes following:
  1. Eclipse IDE for Java and DSL Developers - Downloaded it from eclipse.org, and it has following plugins already added.
    1. Maven 
    2. TestNG 6.1.
  2. Java project with following libs added in Maven pom.xml
    1. Selenium 2.0 (Java WebDriver) 2.44.0
    2. JUnit 3.8.1
    3. ReportNG 1.1.4 
    4. Guice 3.0
If you want to use some other eclipse version and if you want similar setup for that eclipse version then please let me know, I will be very happy to provide / build setup for you.

To Download SeleniumWebDriver_With_Eclipse.zip with all above mentioned plug-ins & Java Project, please click on below image.

How to change JRE version of your Java project in Eclipse

1. Open Eclipse and right click on your Java project, select "Properties"

2. Select "Java Build Path" and go to the "Libraries" tab as shown below.

3. Select the already available JRE library and click on "Edit" button present on right side. You will see one more new windows called "Edit Library" as shown below.

WebDriver is not able to find out WebElement present on Web Application

Recently came across one of the problem and I think it would be helpful to everyone if I share the details.

Problem Statement: WebDriver was not able to find out WebElement

I was using Firefox WebDriver, and in one of my test WebDriver was not able to find out Link / Image / Button for some reason.

HTML page Code look like below: I want to click on "New" link/image.

<div id="toolcontainer">
       <ul id="toollist">
              <li>
                     <a id="btnNewDash" title="New" onclick="javascript:$('#addTab').dialog('open'); return false;" href="#">
                            <span class="toollistimg"></span>
                            <span class="toollisttext"></span>
                        </a>
                 </li>
              <li></li>
          </ul>
   </div>

But when I use below code in my test, it didn't work... I tried following -
Related Posts Plugin for WordPress, Blogger...
Powered by Blogger