Python Selenium problem summary

*******************************************************************************

1. Summarize the problems encountered by driver.switch_to_alert().accept() in handling the pop-up window:

1. It seems to only support the original HTML bullet box. After using the easyui framework before, using the message.alert() bullet box to call driver.switch_to_alert().accept() always prompts that you cannot click or the focus is not found (the bullet frame is positioned)

2. Use the original alert(); method can use driver.switch_to_alert().accept() to click to confirm

3. The writing in the new version of the selenium API seems to be driver.switch_to.alert().accept()

*******************************************************************************

2. Summarize the difference between sleep(), implicitly_wait(), WebDriverWait()

1. time.sleep() After a fixed sleep time, the following code is executed, such as 10S, then 10 waits for 10 seconds before executing the following code, and no error is reported

2. Implicitly_wait() sets the timeout waiting time. If the waiting time is set to 10S, wait for an element to appear. If it does not appear, a timeout exception will be thrown.

3. During the set time, WebDriverWait() checks whether the current page element exists at regular intervals by default, and throws an exception if it cannot be detected after the set time.

*******************************************************************************

 

*******************************************************************************

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325765970&siteId=291194637