1. python-2.7.2.msi (Python installer)
After installing, be sure to add installed directory to your PATH environment.
2. setuptools-0.6c11.win32-py2.7.exe (Package installer)
After installing, be sure to add directory that contain easy_install.exe to your PATH environment variable. In my case it was C:\Python27\Lib\site-packages.
3. chromedriver.exe (Need this for automating in Chrome browser)
Download chromedriver_win_16.0.902.0.zip from http://code.google.com/p/chromium/downloads/list . Remember the location of the chromedriver.exe
4. Text editor(any)
I am using SciTE. Download it from http://www.scintilla.org/SciTEDownload.html
Start the application, select python from language. To run the code press F5.
Steps:
1. Install Selenium. In Command Prompt write easy_install selenium
2. Start writing code
In Chrome:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome("E:\QA\Resource\WEBDRIVER\chromedriverserver\chromedriver.exe")
driver.get("https://www.google.com")
elem = driver.find_element_by_name("q")
elem.send_keys("Hello World!")
Here
E:\QA\Resource\WEBDRIVER\chromedriverserver\chromedriver.exe was my location of
chromedriver.exe.In Firefox:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("https://www.google.com")
elem = driver.find_element_by_name("q")
elem.send_keys("Hello World!")
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Ie()
driver.get("https://www.google.com")
elem = driver.find_element_by_name("q")
elem.send_keys("Hello World!")
I am not sure the place you are getting your information, however good topic. I needs to spend some time studying more or understanding more. Thank you for wonderful information I was in search of this info for my mission.
ReplyDeleteSelenium Training in Chennai
Thanks for sharing the valuable information here. So i think i got some useful information with this content. Thank you and please keep update like this informative details.
ReplyDeleteBack to Original
from my experience point of view score is must and needful for everygraduate students. thanks for valuable article.
ReplyDeleteGermany Education Consultants in Chennai
Good blog post which provided a interesting information hello world webdriver with python.keep updating...
ReplyDeleteSEO Companies in India