Status: exporting to Javascript code
Hey all,
Everything regarding the release of code export to Javascript should be discussed centrally here.
Right now the biggest issue left to resolve is parallelization, I'll submit a followup PR for that, but unless its code specific comments, keep the conversation here.
The latest beta is 3.1.0-beta.7
Please make sure that is the version used before submitting bugs.
Beta 3
No longer need to export to javascript, just run it against your .side files.
Binaries are published as well, this way if you have the binary in PATH, you only need to call it in the project's root, this way, you can avoid installing node and npm.
Beta 7
There is a problem with the parallelization of test cases, I'm working on that, in the meantime I'm removing the feature from 3.1.0.
3.1.0 has great features, and I don't want to delay them anymore, I'm moving this one to 3.2.0.
Hi, thanks for the new post. How can we run the generated JS tests?
This is the head of the generated file
// This file was generated using Selenium IDE
const By = require('selenium-webdriver').By;
const until = require('selenium-webdriver').until;
jest.setTimeout(30000);
afterAll(() => {
Runner.cleaup();
});
const BASE_URL = 'http://localhost';
Do we need a library that combines jest and selenium? Runner and jest are not initialized
Yes, have a look at the README
Hi in the latest release you say that Javascript exporting is no longer needed, in fact, I don't find any button to export to Javascript.
Is it possible to maintain this feature, I really need to see and modify those Javascript files.
Thanks
Hi,
I have the same issue with exporting to Python. We take the initial IDE scripts, convert them to python and then adjust accordingly. Will that be a future enhancement?
I am entirely confused of the answer to the error #211. Can any one explain it to me?.
Yes, exporting in any language is now not allowed. You can only export in the crappy format Selenium team decided. So you can't modify anything
Please be gentle and patient. This feature is going to be implemented sooner or later. If one wants it to progress faster one can give a hand of help, join the team or submit pull requests.
I'll try to address some of the concerns.
The project is still very far behind on features than the predecessor, export included.
And so the first thing we want the IDE to do, is to solve one of the end results of exporting: running headlessly.
That being said, exporting to the plethora of languages available (Selenium bindings), requires a lot of work and maintenance on our part, and in order to move to more complex features sooner, the best solution is to enable you to run the project files, just like that.
Think of this as the HTML runner, we'll make sure you can run your project files first, and then free time to write exporting to different languages.
@Naramsim I think it should be possible to write a "side-to-HTML" converter... I'm going to start looking into this now, because I actually like the User Experience of the Selenium IDE 3.x beta better than the old Selenium IDE 2.x, the export feature is the last piece of the puzzle for my team to adopt it. I'm not a ReactJS/WebExtensions expert so I'll look into a standalone tool first, but if it works out ok, I'm going to get cracking on learning that stuff because I'd also like to add jUnit5 as an export format.
As @barancev said, if you don't like the current state of things, roll up your sleeves and get coding or find some other more constructive ways to help than just complaining... this crew (which I should point out I'm a bystander/lurker on not member of at this time) is doing an awesome job on what I'm assuming is a shoestring, if not completely bootstrapped/volunteer-basis. Its up to all of us, the community to step up and build the features/tools we want.
@bcmoney You're more than welcome.
I'm just hoping that with this runner, that let's you have fine tuning on parallelization (either run suites in parallel, or everything), will reduce the coupling of code export.
My idea is that if you have no use of editing the code once exported or if you don't have an ecosystem around a certain language, then we can do a much better job at managing these suites.
Is there any workaround to export the recorded script. I need to enhance the recorded script. I need to parameterize, add check point validation (data validation, object validation). I also need to add conditions. The recorded and play is really useless unless enhanced. I am looking for a way to export the recorded script so I can edit.
@mgdtest: We just released some new functionality today in 3.2.0 that can get at some of your challenges.
You can now add conditions to your tests with control flow commands (e.g., if, else if, else, end, while, times, do, and repeat if). You can also perform validations with generic assert and verify commands to confirm that variables contain expected values.
I'm not sure what our plans are for parameterized testing, though (that's a good question). But hopefully this helps move you closer to getting value out of your recorded scripts in the meantime.
I checked out 3.2.0 version but I am not able to see the changes. I am not sure how to add conditions. It does not seem to support editing the code at all. Without editing the recorded code to enhance generated code. I don't see this will help my team to automate test cases. Is there away to see/edit generated script?
@corevo "My idea is that if you have no use of editing the code once exported or if you don't have an ecosystem around a certain language, then we can do a much better job at managing these suites." -> a practical example is trying to keep your tests to one test suite - e.g. pytest - and trying to measure coverage.
Good luck on this work! I'd love to see exporting to Python, personally. Great work so far on what exists, it's super easy to use and looks great 👍
I really don't care about adding conditionals or loops to "IDE" at this point. That ship sailed long time ago and I think that 100% of the time people use Selenium "IDE" just to grab gui elements and create a rough draft of the code to use. I have no idea who in their right mind would use it as an actual IDE and keep their tests in Selenese.
Trying to add all these features that may be marginally useful while blocking the functionality that's actually being used a lot is nonsense. I think that your team is detached from reality and trying to muscle the users into particular vision of Selenium use. Thanks, but no thanks. I will find something else to use instead. You are killing off your user-base.
Sometimes a simpler solution just works and there is no need to come up with anything fancier, especially at a detriment of existing functionality.
Thanks for the feedback @oooBORISooo. It's worth keeping in mind that the IDE is used differently by different people. What might not be important to you may be important to others. Conditionals (and control flow in general) were used by many in prior versions of the IDE and this feature set landed months ago. Code export is an important feature too. We're just figuring out when to get the work done amongst everything else going on in the project. It's just me and @corevo pulling weight for the IDE, so if you want to help make code export happen sooner you're more than welcome to chip in.
Has exporting to Python made it in to the official roadmap?
Yes. All of the officially supported programming languages will be added for code export.
when it will be added?
We're going to start work on it later this month, starting with Java and working our way through the other languages after that.