Note: these install instructions are windows-specific, but it’s the same on mac other systems too.
How will this work : we use Chrome to conduct testing, and Firefox to design the tests (chrome does not have an IDE for Selenium).
For our friendly Romanian colleagues: am facut tutorialul acesta de mana, nu este copy-paste de nicaieri, asa ca citeste-l cu atentie 😉
- install python (from https://www.python.org/downloads/)
- use custom install
- tick “Add Python to environment variables”
- remember where you’ve installed it 😉
- Â install selenium using pip (which came with python)
- run this in console: path-of-python-that-you-remember-from-step-1.3/Scripts/pip install selenium
- close the console (!!!)
- test python
- open a new console (!!!)
- type in “python” and hit enter -> check if you are now in the python console
- exit the python console
- create hello.py and put this inside: print(“Bãi!”)
- save and exit
- run it from console: python hello.py -> check if it works
- install chrome driver
- download from https://chromedriver.storage.googleapis.com/index.html?path=2.25/
- save in python/Scripts
- test automation in chrome
- create and save this script as test1.py:
from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Chrome() driver.get("http://www.python.org") assert "Python" in driver.title elem = driver.find_element_by_name("q") elem.clear() elem.send_keys("pycon") elem.send_keys(Keys.RETURN) assert "No results found." not in driver.page_source driver.close() - run it from console: python test1.py
- create and save this script as test1.py:
- at this stage you should have a working python and selenium installation, if all the above tests were ok
- Install Selenium IDE for firefox
- go to https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/
- click the + Add to Firefox button and confirm
- restart firefox
- Selenium IDE is now available in the menu Tools/Selenium IDE or Ctrl+Alt+S
Categories: Automated testing |
Leave a Reply
[TOP]