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

setSpeed command not working in selenium side runner version 4.0.8

Open NikhilHedau opened this issue 9 months ago • 3 comments

🐛 Bug Report

setSpeed command is not working in selenium side runner version 4.8.0. Same is working in selenium side runner version 3.17.0 Attached below is the debug log

info: Running test setSpeed debug: Playing state changed prep for test setSpeed debug: Playing state changed playing for test setSpeed debug: executing setSpeed|10 debug: errored setSpeed|10 debug: Playing state changed errored for test setSpeed info: Finished test setSpeed Failure debug: Last command: {"command":"setSpeed","comment":"","id":"14e7ce9d-1e3d-42c3-8625-cfeb185226b8","target":"10","targets":[],"value":""} FAIL ../.npm-global/lib/node_modules/selenium-side-runner/dist/main.test.js Running project Test Running suite Default Suite ✕ Running test setSpeed (936 ms)

● Running project Test › Running suite Default Suite › Running test setSpeed

`set speed` is not supported in this run mode during setSpeed:10:

  at WebDriverExecutor.doSetSpeed (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:1426:11)
  at executor (node_modules/@seleniumhq/side-runtime/src/playback-tree/command-node.ts:140:53)
  at CommandNode._executeCommand (node_modules/@seleniumhq/side-runtime/src/playback-tree/command-node.ts:152:24)
  at CommandNode.execute (node_modules/@seleniumhq/side-runtime/src/playback-tree/command-node.ts:112:31)
  at Playback._executeCommand (node_modules/@seleniumhq/side-runtime/src/playback.ts:560:22)
  at Playback._executionLoop (node_modules/@seleniumhq/side-runtime/src/playback.ts:438:18)
  at node_modules/@seleniumhq/side-runtime/src/playback.ts:346:9

Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 1.158 s, estimated 2 s Ran all test suites within paths "/Users/nhedau/.npm-global/lib/node_modules/selenium-side-runner/dist/main.test.js". Jest did not exit one second after the test run has completed.

'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with --detectOpenHandles to troubleshoot this issue.

To Reproduce

selenium-side-runner setSpeed.side -c "browserName=chrome" --debug

Expected behavior

Test should pass

Project file reproducing this issue (highly encouraged)

{ "id": "9f62ff1e-d828-4e5c-8ca1-a2352dcb2bed", "version": "2.0", "name": "Test", "url": "https://martinfowler.com", "tests": [ { "id": "799ffc2c-92e2-4b80-a4fe-fbb16ada97c9", "name": "setSpeed", "commands": [ { "id": "14e7ce9d-1e3d-42c3-8625-cfeb185226b8", "comment": "", "command": "setSpeed", "target": "10", "targets": [], "value": "" }, { "command": "open", "target": "/architecture/", "value": "", "id": "b8eb10f0-27c8-440a-bb7f-f68a8da5273c" }, { "command": "close", "target": "", "value": "", "id": "3941818f-93ea-40a4-ac0f-da8f4a9b4eb2" } ] } ], "suites": [ { "id": "35405411-d767-4218-a156-03ffea660a57", "name": "Default Suite", "persistSession": false, "parallel": false, "timeout": 300, "tests": [ "799ffc2c-92e2-4b80-a4fe-fbb16ada97c9" ] } ], "urls": [ "https://martinfowler.com", "https://martinfowler.com/architecture" ], "plugins": [] }

Environment

OS: macOS Sonoma ver 14.3.1, Chip: Apple M1 Pro Selenium IDE Version: Electron version 28.2.0 Selenium SIDE Runner Version: 4.0.8 Please note that selenium-side-runner supports Node.js 16+ --> Node version: 20.11.1 Only required if using selenium-side-runner --> Browser: GoogleChrome Browser Version: 124.0.6367.119 (Official Build) (arm64) ChromeDriver Version : 123.0.6312.86

NikhilHedau avatar May 10 '24 10:05 NikhilHedau

Version is 4.0.8 not 4.8.0

chrisisth avatar May 14 '24 08:05 chrisisth

Thanks @chrisisth for pointing this out.

NikhilHedau avatar May 14 '24 11:05 NikhilHedau

Hi @toddtarsi , Did you get a chance to look into this?

NikhilHedau avatar May 20 '24 07:05 NikhilHedau

Hi @toddtarsi , Were you able to check this?

NikhilHedau avatar Jul 02 '24 08:07 NikhilHedau

I didn't look into this one. setSpeed just adds a timeout in between every step? I don't think this came into v4 since it's generally less preferred to using polling as part of the core click/type/interact logic

toddtarsi avatar Jul 02 '24 13:07 toddtarsi

Yeah, setSpeed delays the Selenium IDE execution speed. setSpeed command is present in the electron app. Is it recommended to use setSpeed in selenium v4 ? If not, are other any other alternatives to this command? I suppose pause can be one.

NikhilHedau avatar Jul 04 '24 07:07 NikhilHedau

@NikhilHedau - So much of all that goes away because there is a base change in the core commands.

Basically, most commands have a built in check over 5 seconds, where it polls two conditions:

  1. Is the element present?
  2. If so, is the element visible?
  3. If so, attempt [action].

Similarly, there are waitFor equivalents on most assert/verify as well.

Occasionally, you'll need a pause here and there for some states that are rapidly transitioning (for me sometimes in React when a component mounts, data goes to validate, component vanishes, and then component remounts).

But generally, in v4, your tests should be more resilient and faster and simpler by design.

toddtarsi avatar Jul 05 '24 13:07 toddtarsi

I have a ticket to make the implicitTimeout configurable, but I'm not sure it's completely live yet.

But yeah, basically there are async versions of all commands, and they're better than static pauses or setSpeed because they'll wait the minimal amount of time necessary and they're built into the core commands so your tests can just focus on having good selectors and such.

toddtarsi avatar Jul 05 '24 13:07 toddtarsi

Thanks for the update @toddtarsi .I will close this ticket for now, will reopen if required.

NikhilHedau avatar Jul 09 '24 11:07 NikhilHedau

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

github-actions[bot] avatar Aug 08 '24 21:08 github-actions[bot]