Você está na página 1de 11

Selenium

Workshop
Environment Preparation Guide

What do you need?


1.
2.
3.
4.
5.
6.
7.

Java JDK
Eclipse
Maven plugin for eclipse
TestNG plugin for eclipse
Setup Maven project in eclipse
Firebug plugin for FireFox
FirePath plugin for Firebug in Firefox

If you already have some of these things or maybe you are using
other IDE that you are comfortable with, you can use it.

1. Java JDK
1. Check if you already have it installed:
in cmd run: javac -version
(or you can search for jdk folder or javac file)

2. If you don't have it, You can download it from this link:
http://www.oracle.com/technetwork/java/javase/downloads/in
dex.html (chose JDK)
3. Run the installer
4. Add it to PATH and JAVA_HOME variables:
Right-click My Computer and click Properties. Click Advanced System Settings
link in the left column. In the System Properties window click Environment
Variables button. Add new variables in System variables (in Variable value
type path to the folder where you installed Java):

Update your Path variable: in Variable value type %JAVA_HOME%\bin;

2. Eclipse
1. Download it and run the installer:
https://eclipse.org/downloads/
You can choose Eclipse for Java Developers version
If you have 32 Bit Windows choose that, but if you have 64 Bit Windows
choose 64 Bit.

2. Unzip folder anywhere you want on the computer.


3. Click on eclipse.exe to start Eclipse. For your Eclipse
workspace, choose whatever folder you want.

3. Maven plugin for eclipse


1.
2.
3.
4.
5.
6.
7.
8.

In Eclipse go to Help -> Install New Software


Click on Add..
In Name field enter Maven
In Location field enter this:
http://download.eclipse.org/technology/m2e/releases

Click OK
Wait for some time for the list to load
Click Select All
Click Next and proceed till the end of the process

4. TestNG plugin for eclipse


1. In Eclipse go to Help -> Install New Software
2. Click on Add..
3. In Name field enter TestNG

4.
5.
6.
7.
8.

In Location field enter this: http://beust.com/eclipse


Click OK
Wait for some time for the list to load
Click Select All
Click Next and proceed till the end of the process

5. Setup Maven project in eclipse


Whe Eclipse is opened you'll see first page. Click at the left upper corner to see
different view:

Then click with the mouse right button into the Package Explorer (the left part of
the Eclipse) and then New and Other:

Choose Maven and then Maven Project. Click Next:

Choose Create a simple project and Use default Workspace location. Click
Next:

Write these data and click Finish:

Now you should see your project hierarchy something like that:

Now inside the Eclipse open the pom.xml file and copy-paste this text (called
dependency) for Selenium WebDriver (from
http://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java/2.45.0 )
and TestNG (from http://mvnrepository.com/artifact/org.testng/testng/6.8.21)
Just infront </project>:
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.46.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.21</version>
<scope>test</scope>
</dependency>

</dependencies>
Save pom.xml (just click CTRL+S) and wait for Eclipse to resolve dependency.
Your pom.xml should see something like that:

6. Firebug plugin for FireFox


In FireFox go to: http://getfirebug.com/ and click on Install Firebug:

7. FirePath plugin for Firebug in


Firefox

In FireFox go to: https://addons.mozilla.org/en-US/firefox/addon/firepath/ and


click Add to Firefox

You are ready for the workshop!

Você também pode gostar