简体   繁体   中英

Selenium Webdriver is suck on the second iteration of the for-loop: it is not finding or selecting an element

The first iteration of the for-loop works perfectly, and the second works fine up until it has to make a selection from the list. The error I received was: "Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: element not visible"

Could this be a time sync issue? If so, wouldn't I have run into this issue in the first iteration? Or, even though I could see the elements in front of me, it is not being selected because it's not an active element?

It's very likely that an action in the for-loop has changed the DOM. So you'd better find the element again inside the for-loop

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