Steps to setup Python+Selenium environment
Steps to setup Python+Selenium environment
- Download latest Python 3 version from https://www.python.orgversion
- Choose create env path automatically during install process ,after install successfully run Python command would show the python version
- Use Third-party libraries to install selenium
- Use Chrome for automation, check local chrome version and download corresponding chromedriver.exe from
http://npm.taobao.org/mirrors/chromedriver/ - Download and Extra the zip file, put the chromedriver.exe to python.exe folder
- Install Python IDE Pycharm , new python file to start your automation
Check project interpreter make sure your env have already install selenium - Eg automation scrip
# coding=utf-8
from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get(“URL”)
driver.find_element_by_xpath("//input[@id=‘XXX’]").send_keys(“XXX”)
driver.find_element_by_xpath("//input[@id=‘XXX’]").send_keys(‘XXX’)
time.sleep(3)
driver.find_element_by_xpath("//input[@name=‘submitForm’]").click()