Last active
April 26, 2020 00:01
-
-
Save pranshuj73/a496cde7417a84d57217f5b1faeb861f to your computer and use it in GitHub Desktop.
code section 2
This file contains 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
# everything here is a part of login function of Tweeter class | |
# Now we need to find the field where we want to type in the username/email | |
uname_field = driver.find_element_by_name("session[username_or_email]") | |
# typing the username | |
# Note: it's important to press tab using Keys.TAB after typing the username | |
# to switch to the password field (or we can add extra lines of code to click on it) | |
uname_field.send_keys(username, Keys.TAB) | |
# selecting the password field | |
pass_field = driver.find_element_by_name("session[password]") | |
# typing the password and pressing enter key using Keys.RETURN to submit everything | |
pass_field.send_keys(password, Keys.RETURN) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment