diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-07 17:47:32 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-07 17:47:32 +0200 |
| commit | 809bc265d11b508903313f5b0a8c1a04add7209b (patch) | |
| tree | 9d5969e599e69d642e02a07eed091bd66765446c | |
| parent | e1bd5ec1c939f5431925ab3bb83352d0a275ebd9 (diff) | |
Python Selenium: Use the new element finding functions
| -rw-r--r-- | selenium_eduvpn.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/selenium_eduvpn.py b/selenium_eduvpn.py index b1c8cfe..b3a7c5f 100644 --- a/selenium_eduvpn.py +++ b/selenium_eduvpn.py @@ -36,24 +36,24 @@ def login_oauth(driver, authURL): sys.exit(1) # Fill in username - elem = driver.find_element_by_name("userName") + elem = driver.find_element("name", "userName") elem.clear() elem.send_keys(portal_user) # Fill in password - elem = driver.find_element_by_name("userPass") + elem = driver.find_element("name", "userPass") elem.clear() elem.send_keys(portal_pass) # Click login button - driver.find_element_by_css_selector( + driver.find_element("css selector", ".frm > fieldset:nth-child(2) > button:nth-child(2)" ).click() # Check that we have reached the approve application page assert "VPN Portal - Approve Application" in driver.title # Click approve - driver.find_element_by_css_selector( + driver.find_element("css selector", ".frm > fieldset:nth-child(1) > button:nth-child(1)" ).click() |
