Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Waiting method in selenium-6 test script

Shulou Source: shulou.com Published: 2022-06-03 07:22:48 09月23日 Update

Example 1:

From selenium import webdriver

B = webdriver.Firefox ()

B.find_element_by_id ("kw") .send_keys ("51cto")

B.implicitly_wait (5) # wait five seconds

B.find_element_by_id ("kw1") # kw1 does not exist here, because the b.implicitly_wait () method is used, so the error is reported when the query times out 5 seconds later.

Application of example 2:WebDriverWait in script

Tags: Methods scripts applications queries tests Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Linux vpn Apple Shulou Tech Info