SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.8k stars 762 forks source link

Unable to export test (version 3.17.2) #1839

Open TJSWANS300 opened 3 months ago

TJSWANS300 commented 3 months ago

Hi.

For Selenium IDE (version 3.17.2), I have a test called Misc/Cleanup.

It is made up of 3 steps:

When trying to export the Test to C# NUnit, the following error shows:

SeleniumIDE error

Could this be down to the Run command inside a test?

toddtarsi commented 3 months ago

Thats a good question. V3 is kinda hitting EOL. I have a recommendation that may help, or may hinder. In v4, I've cut the code export utilities into a standalone CLI tool using npm. Do you have npm on your computer? Basically, you can run code export as it's own utility this way if you do:

npm i -g side-code-export @seleniumhq/code-export-csharp-nunit
side-code-export @seleniumhq/code-export-csharp-nunit ./project.side ./tests                                                     

The advantage to doing this is that the stack trace is viewable and generally there is a lot less technology in the way. Of course the issue is that some commands like storeXPathCount got the axe going from v3 to v4, but there is a migration utility too:

npm i -g side-migrate side-code-export @seleniumhq/code-export-csharp-nunit;
side-migrate ./project.side ./project-v4.side
side-code-export @seleniumhq/code-export-csharp-nunit ./project-v4.side ./tests-v4                                                     
TJSWANS300 commented 3 months ago

Thanks, I'll look into that

TJSWANS300 commented 3 months ago

I still have the same error doing that but we do have more detail:

CMD PROMPT side-code-export @seleniumhq/code-export-csharp-nunit {Whole path to .side file} ./tests

CMD PROMPT OUTPUT C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:46 function findReusedTestMethods(test, tests) { ^

RangeError: Maximum call stack size exceeded at findReusedTestMethods (C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:46:31) at findReusedTestMethods (C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users{username}\node_modules\side-code-export\dist\code-export\find.js:53:42)

Node.js v20.12.2

TJSWANS300 commented 3 months ago

Any update on this?

toddtarsi commented 3 months ago

Ah shoot, no sorry. I first have to figure out a har file thing. However, fixing this should be a lot easier. The stack trace is right there. Can you give me a minimal side file that makes this issue? That will help me fix it faster. I'm sorry, you've caught me in the middle of basically a vacation from OSS.

TJSWANS300 commented 3 months ago

Here is a test side file that uses accounts.google.com with just 1 test

TestProject.zip

toddtarsi commented 3 months ago

Oh neat, basic recursion. Okay, I'll look into it! New core test unlocked

toddtarsi commented 3 months ago

@TJSWANS300 - New version going out now, I think it is quite good at recursion but please let me know what you think.

TJSWANS300 commented 3 months ago

@toddtarsi I've had a look and still having the same error as before :(

Tried using the TestProject file above:

CMD PROMPT side-code-export @seleniumhq/code-export-csharp-nunit Whole\path\to.side\file ./tests

CMD OUTPUT C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:46 function findReusedTestMethods(test, tests) { ^

RangeError: Maximum call stack size exceeded at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:46:31) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42)

Node.js v20.12.2

Does something need updating on my end?

toddtarsi commented 3 months ago

@TJSWANS300 - what do you get for this?

side-code-export --version
TJSWANS300 commented 3 months ago

@toddtarsi 4.0.11

toddtarsi commented 3 months ago

Huh! I'm stumped. I will try with the public binary in tonight. Sorry dude. I mean, there's even a command in the local codebase test:code-export that literally just tests export of script based recursion and dynamic script names.

TJSWANS300 commented 3 months ago

No worries at all. Thought best to let you know.

TJSWANS300 commented 2 months ago

Any update on this?

toddtarsi commented 2 months ago

Ah, not yet. I'll take a look this weekend

TJSWANS300 commented 2 months ago

@toddtarsi No worries - thank you

toddtarsi commented 2 months ago

I'm taking a look at this this weekend, I'm starting to use a 'top priority' label to prioritize what comes first, and this is on that list.

toddtarsi commented 2 months ago

@TJSWANS300 - Okay, just to be safe, I incremented again and tested locally using the recursion side file here:

https://github.com/SeleniumHQ/selenium-ide/blob/trunk/tests/examples/simple-parent.side#L85

(base) ➜  selenium-ide git:(trunk) ✗ npm ls -g side-code-export
├─┬ @seleniumhq/code-export-python-pytest@4.0.12
│ └── side-code-export@4.0.12
├─┬ selenium-ide@4.0.1-beta.14
│ ├─┬ @seleniumhq/code-export-csharp-nunit@4.0.12
│ │ ├─┬ @seleniumhq/code-export-csharp-commons@4.0.12
│ │ │ └── side-code-export@4.0.12 deduped
│ │ └── side-code-export@4.0.12 deduped
│ ├─┬ @seleniumhq/code-export-csharp-xunit@4.0.12
│ │ └── side-code-export@4.0.12 deduped
│ ├─┬ @seleniumhq/code-export-java-junit@4.0.12
│ │ └── side-code-export@4.0.12 deduped
│ ├─┬ @seleniumhq/code-export-javascript-mocha@4.0.12
│ │ └── side-code-export@4.0.12 deduped
│ ├─┬ @seleniumhq/code-export-python-pytest@4.0.12
│ │ └── side-code-export@4.0.12 deduped
│ ├─┬ @seleniumhq/code-export-ruby-rspec@4.0.12
│ │ └── side-code-export@4.0.12 deduped
│ └── side-code-export@4.0.12
└── side-code-export@4.0.12

(base) ➜  selenium-ide git:(trunk) ✗ side-code-export ./packages/code-export-python-pytest/dist/index.js ./tests/examples/simple-parent.side ./output-tests
Encountered a dynamic test declaration, including all tests as methods - will bloat code
Encountered a dynamic test declaration, including all tests as methods - will bloat code
Encountered a dynamic test declaration, including all tests as methods - will bloat code
Encountered a dynamic test declaration, including all tests as methods - will bloat code
Encountered a dynamic test declaration, including all tests as methods - will bloat code
Encountered a dynamic test declaration, including all tests as methods - will bloat code
Encountered a dynamic test declaration, including all tests as methods - will bloat code
Encountered a dynamic test declaration, including all tests as methods - will bloat code
(base) ➜  selenium-ide git:(trunk) ✗ 

Seems to transpile fine on latest!

TJSWANS300 commented 2 months ago

@toddtarsi I've had a look and still having the same error as before :(

Tried using the TestProject file above:

CMD PROMPT side-code-export @seleniumhq/code-export-csharp-nunit Whole\path\to.side\file ./tests

CMD OUTPUT C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:46 function findReusedTestMethods(test, tests) { ^

RangeError: Maximum call stack size exceeded at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:46:31) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42) at findReusedTestMethods (C:\Users\{username}\node_modules\side-code-export\dist\code-export\find.js:53:42)

Node.js v20.12.2

side-code-export --version = 4.0.12

Does something need updating on my end?

toddtarsi commented 2 months ago

Damn, @TJSWANS300 - Can you post a side file reproduction? I'm a bit confused because yeah this is now part of the core CI:

https://github.com/SeleniumHQ/selenium-ide/blob/trunk/package.json#L25

Basically, this has a recursive test that does some dynamic stuff, and I don't think yours does. I need to figure out that difference so I can make it a core test too.

TJSWANS300 commented 2 months ago

Damn, @TJSWANS300 - Can you post a side file reproduction? I'm a bit confused because yeah this is now part of the core CI:

https://github.com/SeleniumHQ/selenium-ide/blob/trunk/package.json#L25

Basically, this has a recursive test that does some dynamic stuff, and I don't think yours does. I need to figure out that difference so I can make it a core test too.

Here is a test side file that uses accounts.google.com with just 1 test

TestProjectIDE.zip

toddtarsi commented 2 months ago

@TJSWANS300 - Thank you, if I'm caught up on work tonight, I'll take a look. I want recursion to be fully functional in code-export, and will make sure of it.

TJSWANS300 commented 2 months ago

Any update on this?

toddtarsi commented 2 months ago

Nah, sorry. It's one of like four issues with top priority (key-chord support in sendKeys, nested variable paths in sendKeys, multi layer recursion, break-fixing javascript-mocha code-export). It's getting worked on, but I'm kinda shelved for a week or two unfortunately.

TJSWANS300 commented 2 months ago

No worries

toddtarsi commented 2 months ago

Thank you