Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
412 views
in Technique[技术] by (71.8m points)

selenium - Wait for a web element while continuing testing

Is there a way to wait for a web element, while continuing testing?

For example, you have a web page with a search box and a tab of results, every search takes around 15 minutes each, but it can be more.

A new record shows up on the results tab when the results came back.

Is there any way to continue sending queries while "observing" for the results? I need to update online a GUI on every search that returns results.

question from:https://stackoverflow.com/questions/65908775/wait-for-a-web-element-while-continuing-testing

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Good practices state that tests should be hermetic, i.e. independent and self-sufficient. So usually we try not to chain different tests. In your case where

every search takes around 15 minutes each

most likely means that each search is a test of its own. Simple and pragmatic way to

continue sending queries while "observing" for the results

would be to leverage parallel test execution. Each thread manages its own Selenium Webdriver life cycle, steps and expected results.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...