Selenium(6): The reason why the positioning cannot be successfully located through various positioning methods

Scenario: After successfully changing the password, a message indicating that the change is successful will pop up.

After positioning by id, xpath, class, and css, an error will occur when this step is performed. Think about it, you shouldn't. It should be a problem with the settings there. After checking the code carefully, it is found that the sleep time is not set between the operation of submitting the modification and the prompt of the modification being successful.

As a result, if the successful modification page has not been loaded, the positioning will fail, so there will be a failure.

Note: In each step of the positioning operation, you need to pay attention to whether the page is loaded. Whether the set sleep time is reasonable.

 

Guess you like

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