简体   繁体   中英

Selenium Alert Box Java

I have a more general question without source examples.

I have - until now - three Selenium/Java tasks running with Jenkins. All of them have alert boxes which handeld usually correct. But sometimes, I get the error, what the expected text not appeared or that the alert box doesn't exist. The alert text in the different Selenium/Java tasks is the same!

Is it possible, I can't look the whole time on the screen, what sometimes the alert box of - for example Selenium/Java task 1 - closes also the alert box of an other Selenium/Java task 2 or 3, which appears at the same time?

If so - how can I make sure, that only the right one is closed?

1) If you run your tests at the same time (parallel) you have to use threads, then webdriver will close the right one AlertBox ( link or link )

2) If you run your tests not at the same time you can do screenshot ( link ) and copy innerHTML of whole page in selenium driver ( link ) when something goes wrong and analyze what exactly happened in that case. You of course can do screenshot and copy innerHTML of whole page when you run your tests parallel.

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