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

As a Selenium IDE User, I would like to be able to add a command to a particular Script in a Test Suite to run slower than the default speed of execution for the whole Suite

Open jobs4mvr opened this issue 4 years ago • 10 comments

🚀 Feature Proposal

As a Selenium IDE User, I would like to be able to add a command to a particular Script in a Test Suite to run slower than the default speed of execution for the whole Suite, so I can have some of the Scripts in the Suite run at a different speed and not fail.

Motivation

Some of my Scripts in the Suite are failing, randomly, and adding Implicit Wait (Wait for Element Present etc.) and/or Pause commands are not helping at all.

Example

These scripts keep failing when run at the default speed for the Suite. I am able to get these failing Scripts to pass when I run these Scripts (separately) at (say) half the default speed that is set for the whole Suite. If there were a command that I could insert at the beginning of such failing scripts alone. At runtime these scripts will be executed at a speed different from the speed at which the rest of the scripts in the Suite run, thereby reducing failures. This would be a great win.

jobs4mvr avatar Aug 11 '21 16:08 jobs4mvr

@jobs4mvr - I'm pretty confused by this ask. What does it mean to run at half speed?

toddtarsi avatar Sep 13 '21 15:09 toddtarsi

Obviously, I didn't raise the issue, but I think I understand the request as I've had a similar thought myself. If you want to run a test suite with most of the tests running at full/fast speed: image ...but some at a slower speed: image ...there's no obvious way that I've found to command certain tests to run slower, then all subsequent tests to return to the originally-selected speed. The 'set speed' command says it affects all tests globally until changed, which wouldn't quite achieve this.

capedavenger avatar Sep 30 '21 10:09 capedavenger

Oh, wow! This might sound silly, but I've actually never clicked that button before. No idea that was even a capability of this system. Thank you for explaining this feature to me, and I'll make sure to keep it in mind while working on the next version in my evenings.

Yeah, that feature as it exists seems like a good step, but maybe it could stand to go farther in the future.

toddtarsi avatar Sep 30 '21 15:09 toddtarsi

We all learn something every day! Glad I could help.

capedavenger avatar Oct 01 '21 07:10 capedavenger

The old IDE used to let you change it at will in the steps. So if you had a script that walked through a site and one of the pages was slower than the rest, you could just use the setSpeed to 500 (could set it to whatever you want really), it would run each step with a 500ms pause between each step. Then set it back to setSpeed 0 to go back to the default.

I used it in the new IDE too and it does seem to work as it did before.

98gmarquee avatar Oct 01 '21 14:10 98gmarquee

@98gmarquee @capedavenger @jobs4mvr - Sorry to take so long to come back here. Is it sufficient for now that there are manual pause commands and wait for xyz commands? These in some sense let you slow-down a step.

toddtarsi avatar Nov 18 '21 14:11 toddtarsi

Ah, I see. This wasn't step level, but allowed you to set a speed going forward. Hmm.

toddtarsi avatar Nov 18 '21 14:11 toddtarsi

That's right. So there's (seemingly) no way to capture the previous running speed, change the speed, then return to the previous speed later. You can set the speed for a specific test at the start of the test, then set another speed at the end, but that might be different to the initial speed. If that makes sense...

capedavenger avatar Nov 18 '21 15:11 capedavenger

@capedavenger - Makes perfect sense. A lot of the pain points this addresses can also be minimized by adding manual timeouts to steps, but I don't like functionality disappearing either. This will probably be something I get to in the medium term, maybe early next year.

As far as test speed working globally, I am skeptical for how best to approach that. Our code-export utilities support exporting tests, suites, or projects I believe. It seems like it should be on the test level.

toddtarsi avatar Nov 18 '21 16:11 toddtarsi

Related: #385 I've had the same issue with tests running with the side runner. Random fails while no issues at all when running with the IDE.

My workaround: add a 333ms sleep after each step by simply doing search/replace on your .side file.

search: }, {

replace: }, { "id": "8e7b6df7-21c1-4284-8aad-efbe3ec82afd", "comment": "", "command": "pause", "target": "333", "targets": [], "value": "" }, {

JeroenAdam avatar Jan 17 '22 09:01 JeroenAdam

v4 is going to be the primary version in January. In v4, we won't support test level timeouts between steps. We have 'wait for xyz' functions that allow for working async without this issue, but pauses for other reasons have to be specified as steps. This is by design in v4, please feel free to re-open if you're unable to get needed functionality.

toddtarsi avatar Nov 18 '22 04:11 toddtarsi

At least, I'm not supporting it out the gate. If you really need it, feel free to re-open the issue.

toddtarsi avatar Nov 18 '22 04:11 toddtarsi

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Dec 19 '22 01:12 github-actions[bot]