Skip to content

Meeting 2020 09 11

Chenghao edited this page Sep 22, 2020 · 1 revision

Agenda

  • Selenium check password

    1. 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 contain class: 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 css class = xxx yyy none.
    1. 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 raise ElementNotInteractableException

    2. 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.

Next Steps

  • Iterate the index menu and the detail page to check DHCP label