Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
411 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...