Last active
January 26, 2017 00:37
-
-
Save tsundara/0b372011a19b939f45379fa793f3f41a to your computer and use it in GitHub Desktop.
Selenium Python Login Test on Chrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This gist shows how to perform Browser testing using Selenium Webdrier & Python | |
#Ensure that you have downloaded ChromeDriver.exe and placed it in some directory,say C:/binaries | |
#Also make sure C:/binaries is set in your windows %PATH%. For testing, you can use the below set command : | |
#set PATH=C:/binaries;%PATH% | |
from selenium import webdriver | |
browser = webdriver.Chrome() | |
#If a blank Chrome window opens up, you are good to proceed with next steps | |
browser.get('http://website:8000/Login') | |
username = browser.find_element_by_id("loginname") | |
password = browser.find_element_by_id("passwd") | |
username.send_keys("[email protected]") | |
password.send_keys("secretpassword") | |
#This will click the Submit or Login button | |
browser.find_element_by_name("loginBtn").click() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment