简体   繁体   中英

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). 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.

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).

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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