Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium IDE stuck on "Preparing to run your test"

I have a test in Selenium IDE which looks like this. Say that our base URL is https://stackoverflow.com.

  • open /questions
  • pause 500
  • type id=search hello

When I run the test, the first two steps are marked in green, but in actuality the browser is still at `moz-extension://blahblah/bootstrap.html, which says "Preparing to run your test". So then any subsequent tests that rely on the page actually being there will timeout and fail. I've disabled all other extensions besides Selenium and the issue persists.

What might be the cause of this issue?

like image 466
mic Avatar asked Nov 29 '20 18:11

mic


Video Answer


3 Answers

TLDR: Insert any command before the first open command (even an empty/disabled one), magically fixes it.

What I've noticed about this issue is that it only happens when the browser window your tests run in isn't opened yet. When you stop test execution but leave the window open and then run the test again, everything works as expected.

So what appears to happen is that the open command is run when the browser window is still opening and the page specified doesn't actually get opened, leaving you at the default page. Now the next command that tries to do anything specific to the page gets stuck because you're not on the correct page.

Now for some reason, doing absolutely ANYTHING before calling the open command fixes this. Simply insert a new command before "open" and that does the trick.

Insert an empty command before "open" on line 1

If that doesn't work for you then you can use "pause" for a few milliseconds so that the window has time to open before opening the page, but that shouldn't even be necessary.

like image 98
Sander Avatar answered Oct 17 '22 15:10

Sander


That same thing happened to me a few times and I'm not sure what caused it. So what I figured out was that if you click on the first line of your test, and then hit the the run button, it won't get stuck on that message.

like image 37
Natalia Avatar answered Oct 17 '22 13:10

Natalia


For me it worked by either slowing the execution speed or more efferent way would be use setSpeed command and set time as 1000 milliseconds just before open command is being called & then once it has been called, again use setSpped command and set time as 0.

Refer to this screenshot

like image 1
Atul Avatar answered Oct 17 '22 14:10

Atul