简体   繁体   English

硒用python挂在按类名的查找元素上

[英]selenium hangs at find elements by class name with python

some places, where I'am using find elements, it hangs for 2-3 minutes (or even more). 在一些我使用find元素的地方,它挂了2-3分钟(甚至更多)。 The page is loaded fully, there is no wait, it's only one line like this: 该页面已完全加载,无需等待,只有这样一行:

menu = self.driver.find_elements_by_class_name("text")

is there any way to avoid this long wait time or what could be the reason for that? 有什么办法可以避免这么长的等待时间,或者是什么原因呢? I'm using python 2.7, selenium 2.44.0 with FF 33.1. 我使用的是python 2.7,硒2.44.0和FF 33.1。

thanks. 谢谢。

is there any way to avoid this long wait time or what could be the reason for that? 有什么办法可以避免这么长的等待时间,或者是什么原因呢?

According to your comments, the app that you are testing is indeed not "loaded fully" (you confirmed that when you said it takes 2-3 minutes manually). 根据您的评论,您正在测试的应用程序确实没有 “完全加载”(您确认说时需要手动花费2-3分钟)。

The only way to avoid this long wait time, is to improve the optimization of the app you are testing. 避免如此漫长的等待时间的唯一方法是改善您正在测试的应用程序的优化。 2-3 minutes is a tremendous amount of wait time, and any client that has to wait for that, will become very impatient. 2-3分钟是非常长的等待时间,任何必须等待的客户都会非常不耐烦。

The reason for the wait time is the app optimization (or lack thereof) or the server performance. 等待时间的原因是应用优化(或缺少优化)或服务器性能。 If you can improve these pieces, then the wait time will go down. 如果您可以改进这些内容,那么等待时间将减少。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM