To check that you do follow these instructions:
• Click on Start
• Click on Run…
• Type in cmd and click Ok
• Type in java –version and push Enter If you have JRE installed it will echo back a versionIf you do not have JRE it will receive an error message
Go to http://www.java.com/en/download/manual.jsp to download the installation file.
Install jdk 1.6 for windows from site - https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewFilteredProducts-SingleVariationTypeFilter
Installation:
Your first step will to be to get Selenium:
Go to http://selenium-rc.openqa.org/download.html and download the zip file.
After it has finished downloading, you need to extract the files to your C: driver directory.
In windows you would take the following steps:
1. Right Click on the zip file you just downloaded
2. Click on Extract All...
3. Click Next
4. Click on Browser…
5. Click on My Computer
6. Click on Local Disk (C:)
7. Click on OK
8. Click on Next
9. Click on Finish
At this point your Selenium files are where they need to be and ready to be used.
Now that you have installed the Selenium files, you need to let windows know where to look if you run a selenium command. You do this by adding the Selenium directory to your environment path:
To add Selenium to your Windows environment take the following steps:
1. Click on Start
2. Right Click on My Computer
3. Click on Properties
4. Click on the Advanced tab.
5. Click on Environment Variables
6. On the upper half there should be a Variable named PATH
a. If you located it, double click on it, and add this value at the end of what is already in “Variable value”:
;C:\selenium-remote-control-0.9.2\selenium-server-0.9.2\selenium-server.jar
Make sure you replace -0.9.2 with the version you downloaded
b. If you do not located it, do this:
i. Click on New
ii. For Variable name: enter: PATH
iii. For Variable value: enter:
C:\selenium-remote-control-0.9.2\selenium-server-0.9.2\selenium-server.jar
(Make sure you replace -0.9.2 with the version you downloaded)
iv. Click on OK
7. Click on OK
8. Click on OK
Now you have finished setting up the environment, the next step is to run a few selenium commands.
Ok now we are going to run some basic selenium commands from the command line.
To start off lets first open the command line window:
1. Click on Start
2. Click on Run…
3. Type in cmd
Now that the command line window is open lets try some basic Selenium commands as mentioned on the Selenium tutorial page (http://wiki.openqa.org/display/SRC/Selenium+RC+FAQ)
• First we need to start up Selenium, we do this by typing in the following:
java -jar c:\selenium-remote-control-0.9.2\selenium-server-0.9.2\selenium-server.jar -interactive
(Once again make sure you replace 0.9.2 with the version number you are using)
• Now that Selenium is up and running we can run some Selenium commands.
To open up Internet Explorer and go to Google, you need to first create a Browser session. A Browser session is what selenium will use to target the browser and execute its commands.
To create a Browser Session type in the following command and push Enter
cmd=getNewBrowserSession&1=*iexplore&2=http://www.google.com
• After you execute this command, wait a few second to allow Selenium to run its course. By the time it has finished executing, a new browser should have opened up.
Now going back to the command line, you should see the following statement as the last line printed out:
Got result: OK,278394 on session 278394
Remember that you will not have the same session number as the one shown above. As long as it has the same format:
Got results: OK,
You are fine.
If you don’t get this message, make sure you typed in the command correctly, and if you are still having trouble, visit the Selenium website for help with troubleshooting.
Now that you have your session and browser up and running, it is time to go visit the Google website. To do this type in the following command with your session number;
cmd=open&1=http://www.google.com/webhp&sessionId=
EXAMPLE:
cmd=open&1=http://www.google.com/webhp&sessionId=278394
cmd=open&1=http://www.google.com/webhp&sessionId=181cf02b49344feebc24ad2f61af626d
If you check your browser now, you will see that it is pointing to google.com.
CONGRAGULATION! You have now finished setting up Selenium and executed a few simple commands.
Good luck and have fun learning to use Selenium!
thanks for this selenium beginners guide keep updating
ReplyDeleteSelenium training in chennai