Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to pause using PHPUnit extending Selenium

My tests are running too fast, and the code always fail. Is there a way to pause?

I tried $this->pause('3000'); and $this->wait('3000'); but it doesn't work.

Right now, I'm using $this->setSpeed('3000'); but it's running too slow.

like image 905
yan Avatar asked Apr 14 '26 09:04

yan


2 Answers

If you really need to wait a fixed amount of time: Sleep function will work as you would expect.

But better solution is to wait for elements/text to be visible - the test will be able to resume work almost immediately after an HTML element is ready.

like image 133
Josef Cech Avatar answered Apr 21 '26 02:04

Josef Cech


Use setSpeed(300) it is reasonable speed to see what is happening on the screen

like image 22
Ajeet Singh Avatar answered Apr 21 '26 04:04

Ajeet Singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!