理解常见的异常
如何处理Selenium代码中的各种问题.
It is not always obvious the root cause of errors in Selenium.
The most common Selenium-related error is a result of poor synchronization. Read about Waiting Strategies. If you aren’t sure if it is a synchronization strategy you can try temporarily hard coding a large sleep where you see the issue, and you’ll know if adding an explicit wait can help.
Note that many errors that get reported to the project are actually caused by issues in the underlying drivers that Selenium sends the commands to. You can rule out a driver problem by executing the command in multiple browsers.
If you have questions about how to do things, check out the Support options for ways get assistance.
If you think you’ve found a problem with Selenium code, go ahead and file a Bug Report on GitHub.
Want to support the Selenium project? Learn more or view the full list of sponsors.