I am facing a challenge with updating my old test scripts that were originally created for the outdated Selenium IDE. The task at hand is to modify them to work with the latest version of Selenium, but I am struggling to make sense of how to handle sections of JavaScript code and adapt to the new syntax.
For instance, one part of the script looks like this:
(command)STORE (Target) javascript{Math.floor(Math.random()*100000)} (Value) ReportNumber
However, when using the old syntax, Selenium simply stores the JavaScript expression as a variable. I have learned that the new IDE requires us to utilize 'Run Script' instead, but I am unsure about how to execute the JavaScript code and save it as a variable. So far, my attempts have been unsuccessful. Has anyone successfully tackled this issue and managed to effectively run and store JavaScript as a variable? Any examples would be greatly appreciated!