-
Notifications
You must be signed in to change notification settings - Fork 0
Meeting 2020 09 11
Chenghao edited this page Sep 22, 2020
·
1 revision
-
Selenium check password
- Approach 1: use xpath to filter the password
password = driver.find_elements_by_xpath(//*[not(contains(@class,'none'))]//input[contains(@type,'password')])
In theory, this could work. But the problem is:
- the
input
label may have many ancestors, maybe the parent of input does not containclass: none
, while the grandparent contains, this syntax will still return the Hidden password. - Different webpage has different css style, for Tenda router, they sometimes use
style: display = none
, sometimes use their cssclass = xxx yyy none
.
-
Approach 2: No matter password or submit shown on the screen, we just fill the password and send. Use simple
try...except
to handle. How can I check if an element attribute returns “display: none” in selenium? This approach will raiseElementNotInteractableException
-
Approach 3: Use selenium
is_displayed()
function to check if the block appears or not on the webpage.
-
When we disable the DHCP for Tenda router and disconnect from the WIFI, if we try to re-connect it again, we will not get an IP address. That is the reason why the program returns an error when I present last Friday.
- Iterate the index menu and the detail page to check DHCP label
-
Weekly meeting
-
Helpful Sources