selenium-ide icon indicating copy to clipboard operation
selenium-ide copied to clipboard

Make play from this command use existing window session

Open saradhit opened this issue 8 years ago • 30 comments

🐛 Bug Report

I just got my Selenium IDE updated to v3.4.0. My script starts with "open" command, as expected, it opens up the web browser and logs me in successfully.

My script failed due to an assertion. When i started the execution by right clicking on the command and selecting "Play from here", it is opening a new browser window and by default closes the existing browser.

As it is closing the browser that the script was already running and tries to use the new browser window for execution script is failing as the elements didn't match.

To Reproduce

  1. Open Firefox a browser (62.0.3 (32-bit))
  2. Click on selenium IDE icon (V3.4.0)
  3. Start execution - My script has a open command as 1st command, So It is opening a new browser window and starting execution. It is ignoring the browser using which the IDE is opened for the first time.
  4. Script failed due to an assertion
  5. I right clicked on the command failed, selected "Play from here". It opened a new browser window and tried to execute the script, but failed as the new browser window is a blank.
  6. Whenever i tried to execute by selecting the "Play from here" command, it repeats the same behavior as mentioned in step 5.

--- It is totally blocking my test execution by opening up a new browser window (not tab) every time i try to execute the script.

Expected behavior

As we are opening selenium IDE by clicking on selenium icon on the browser toolbar, it is not required to open a new window when we start execution.

Also, It should not open a new browser window every time when user tries to execute the script from the step where it failed.

Project file reproducing this issue (highly encouraged)

Sorry...I am not allowed to Share the project details. But this can be easily reproducible.

Environment

OS: Windows 10 Enterprise, Version - 1703, OS Build - 15063.1324 Selenium IDE Version: V3.4.0, updated Today. Selenium SIDE Runner Version: v3.2.0

Browser: Fire fox Browser Version: 62.0.3 (32-bit)

saradhit avatar Oct 04 '18 15:10 saradhit

"Play from here" is a feature that has been falling behind, especially for more advanced tests, that use control flow, run and other powerful features.
We are planning changes to it, for the meantime, what I would suggest you, is that if you're debugging a test case, turn on the pause on exception (the button left to the record).
It will pause your test case when it errors, and will allow you to retry the command until the test case is fixed.

corevo avatar Oct 04 '18 16:10 corevo

@corevo Before test execution, i turned on Pause on Exception and started execution. At one point, my script failed due to an assertion and script was paused as expected. After fixing the step, i clicked on "Resume Test Execution", execution was stopped automatically. Pause on Exception still shows as enabled.

saradhit avatar Oct 04 '18 16:10 saradhit

It paused when no exception was hit?

corevo avatar Oct 04 '18 17:10 corevo

Yes, it paused the test execution.

saradhit avatar Oct 04 '18 17:10 saradhit

I will make sure to take a look, other than that did that do the work?
We are going to improve that feature, adding strong debugging tools will eventually become the alternative.

corevo avatar Oct 04 '18 17:10 corevo

Pausing on exception didn't solve my problem. As i mentioned, after the script was paused, i fixed the step and clicked on "Resume Test execution" button (||) which is actually stopping the test execution instead of Resuming the test execution from where it was paused.

saradhit avatar Oct 04 '18 17:10 saradhit

Would it be possible to add a button next to 'Disable breakpoints' called 'Start with new window' that we could turn off?

We really need the ability to "Play from here" on a test which encounters an error without starting a new browser window. We use Selenium IDE tests for lots of reasons. Some developers run one script to log into an app, and then another script to do some updates. We might have a test that passes running against Production, but for some reason one step fails in Dev. We really need the ability to continue the test starting on the next step without making changes.

One of many Selenium IDE 1.0 Test Suites we have that we converted over to Selenium IDE TNG had 30 test .html files. This resulted in a .side file that is 950kb. There are times when a test may have failed after 10 minutes because of some known error and we just want to finish out the last 50 steps. Being able to turn off 'Start with new window' would really be helpful.

Lastly... thanks so much to you and the team working on the new Selenium IDE. We have extensive tests/support scripts defined using the old Selenium IDE format and you have given us a way to migrate forward.

-- Jeff

JavaJeffG avatar Oct 04 '18 19:10 JavaJeffG

I'm running into a similar issue where it fails because it takes longer than 30sec for an element to become editable. Then when I try to restart/continue, it starts over with a fresh window vs where it stopped. I had the "pause on exception" clicked, but when I continue, it clears the url and starts over.

I didn't have a timeout issue like this previously, it seemed to wait a lot longer.

98gmarquee avatar Oct 05 '18 00:10 98gmarquee

I've the same problem as @saradhit. After an error, when I click on "Play from here", the page is refreshed... Play From here is an essential function for us. We downgrade to 3.3.1 waiting correction

julienb81 avatar Oct 05 '18 09:10 julienb81

Pause on exceptions doesn't work correctly, I'll ship a hotfix immediately.
The idea is that it will pause on the first error, and continue from there once the error is fixed.

corevo avatar Oct 05 '18 09:10 corevo

@julienb81 "Play from here" can't work with the more advanced features of the IDE, "Pause on exceptions" is the way to go.
We are planning to change that, but it will no longer work like it used to.

corevo avatar Oct 05 '18 09:10 corevo

After an error, when I correct it, I often need to click on Play from here a few lines before the error. Will it work after your hotfix?

julienb81 avatar Oct 05 '18 09:10 julienb81

The hotfix is for "Pause on exceptions"

corevo avatar Oct 05 '18 09:10 corevo

@corevo Ok. Will it be possible to restart at the line I want after an error without Selenium to refresh the page?

julienb81 avatar Oct 05 '18 09:10 julienb81

Yes, that's exactly what pause on exceptions is for.

corevo avatar Oct 05 '18 09:10 corevo

Attaching example of "Pause on exceptions" in action pause-on-exceptions

corevo avatar Oct 05 '18 09:10 corevo

@corevo Thanks for your example. The problem is at line 4. Will it be possible to resume at line 3 by example (without restarting the page)?

julienb81 avatar Oct 05 '18 09:10 julienb81

At the moment what you can do, is after fixing line 4, if you want to execute line 3, you can do it by double clicking it, or by pressing "x", to execute it specifically.
Going back is more complex, but telling the IDE, I want you to stop at line 4, and then manually executing the lines you wish is definitely possible.
We could try to improve it, by maybe letting you specify a range of lines to execute.

corevo avatar Oct 05 '18 09:10 corevo

@corevo Thanks for your explanation. I don't think I need a fonctionnality to specify a range of lines to execute. If I can double click to execute a line when the script is on pause, and resume the script after, I think it will be a good solution. What I see as an advantage is that it will keep my variables.

julienb81 avatar Oct 05 '18 10:10 julienb81

I am suddenly experiencing the same issue having today updated to 3.4.0, i can't confirm the previous version installed but the same test /test suite was seen working fine earlier today. Browser: Firefox 62.0.3 (64-bit) I can't get any test to run without it opening a new browser instance. This happens still after killing all firefox processes and starting fresh, opening the project, and trying to run the first test.

FunkyAlex avatar Oct 05 '18 10:10 FunkyAlex