Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status: exporting to Javascript code #131

Closed
corevo opened this issue Mar 19, 2018 · 37 comments
Closed

Status: exporting to Javascript code #131

corevo opened this issue Mar 19, 2018 · 37 comments

Comments

@corevo
Copy link
Member

corevo commented Mar 19, 2018

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.

@Naramsim
Copy link

Naramsim commented Mar 20, 2018

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

@corevo
Copy link
Member Author

corevo commented Mar 20, 2018

Yes, have a look at the README

@Naramsim
Copy link

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

@QA1MTG
Copy link

QA1MTG commented May 3, 2018

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?

@makarun007
Copy link

I am entirely confused of the answer to the error #211. Can any one explain it to me?.

@Naramsim
Copy link

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

@barancev
Copy link
Member

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.

@corevo
Copy link
Member Author

corevo commented May 28, 2018

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.

@bcmoney
Copy link

bcmoney commented Jun 4, 2018

@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.

@corevo
Copy link
Member Author

corevo commented Jun 4, 2018

@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.

@mgdtest
Copy link

mgdtest commented Aug 13, 2018

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.

@tourdedave
Copy link

tourdedave commented Aug 13, 2018

@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.

@mgdtest
Copy link

mgdtest commented Aug 14, 2018

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?

@dibstern
Copy link

@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 👍

@oooBORISooo
Copy link

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.

@tourdedave
Copy link

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.

@monokal
Copy link

monokal commented Dec 3, 2018

Has exporting to Python made it in to the official roadmap?

@tourdedave
Copy link

Yes. All of the officially supported programming languages will be added for code export.

@contorax
Copy link

when it will be added?

@tourdedave
Copy link

We're going to start work on it later this month, starting with Java and working our way through the other languages after that.

@danidee10
Copy link

I'll be waiting for this feature. In the meantime I'll just transform it manually 😢

@tourdedave
Copy link

tourdedave commented Dec 13, 2018 via email

@corevo corevo pinned this issue Dec 18, 2018
@EmmGeeTee
Copy link

Any chance you can re-release the old version as well, I need the export to C#?

@corevo
Copy link
Member Author

corevo commented Jan 2, 2019

As @tourdedave mentioned, first we'll add Java, then we will add more languages, we will go by the popularity of the bindings.
Eventually we will have Java, C#, Python, Ruby and JavaScript.

@evgeniy-mh
Copy link

Hello @corevo , I want to contribute to this project and add support for CodeceptJS syntax.
I already read about Selenium IDE plugin system and didn't found anything useful for my problem.
Do I need to fork Selenium IDE project and add code for my feature in Selenium IDE code?
Can you give me an advice where to start?

@corevo
Copy link
Member Author

corevo commented Feb 12, 2019

Hey @evgeniy-mh, thanks for reaching out, I think that once we have the Java ones ready you will have a great implementation reference to draw from.

We will make exporting available either straight from the IDE itself, for the most common use-case like Java JUnit, but also through plugins for less common use-cases, or the exports that don't use the official Selenium bindings directly, like CodeceptJS.

We will make sure to update the plugins API documentation once it's available.

@evgeniy-mh
Copy link

Thank you, @corevo
So currently there is no Selenium IDE API for plugins that can help me with my CodeceptJS plugin? For example an event that fires when user wants to save test, so I can convert it to CodeceptJS syntax.

@corevo
Copy link
Member Author

corevo commented Feb 12, 2019

Not at the moment, but if you build a tool that converts it in Javascript, by reading the side file, converting it into a plugin would be trivial, since we will give you the exact same object that will be written to the file.

@edpichler
Copy link

The team removed the already very used export feature to re-release it?

@johanneswilm
Copy link

Does anyone have a real world example of where someone actually uses these side files for testing a complex web app? I'm curious as to how one would actually go about doing that. I always need to do quite a lot of manual changes myself. If there are no real-world examples, maybe it would be an idea to add somewhere that this is more of a beta test? It's quite annoying to have gone through creating the entire script only to find out that one is stuck with a not all that useful .side-file.

Are there any alternative tools that are able to export to Python and/or JavaScript?

@tourdedave
Copy link

@johanneswilm What are some examples of changes you generally need to make?

@tourdedave
Copy link

@edpichler We didn't remove it. We just didn't port everything from the legacy Selenium IDE. We're actively working on building reliable and maintainable features for the community. Code export is coming soon. We appreciate your patience, and welcome any contributions if you want to chip in and help out.

@edpichler
Copy link

@edpichler We didn't remove it. We just didn't port everything from the legacy Selenium IDE. We're actively working on building reliable and maintainable features for the community. Code export is coming soon. We appreciate your patience, and welcome any contributions if you want to chip in and help out.

Oh, now I understand it. I am sorry if I was rude.

But it would be cool to be easy to find the old version. I was needing it but I put aside it and used JMeter because the new Selenium IDE version is not compatible with Taurus and other tools that supported Selenium.

@johanneswilm
Copy link

@tourdedave Examples for when I need to make adjustments and run other python code in the middle of a selenium test are anything that has to do with contenteditable. It's very hard or impossible to set the caret in a specific place inside of a contenteditable element and then send keys. So I need to add some JavaScript to be able to move the caret that way. I see with the new Selenium IDE seems to replace the entire element rather than send keys, so that problem has not gone away.

Another example has to do with logging in where I don't actually log in but copy the values I get from the server code to the client to then be logged in. A third example is in collaborative editing tests where I need two different clients to wait on each other at different times. Some of it is waiting for things that have happened on the server side whereas other times it's waiting for things that are happening in the other client.

I think a lot of this has to be programmed by hand but it used to be helpful to have less technically focused collaborators create a first version with the Selenium screen recorder. That's where I'm wondering: Are there other alternatives out there that are currently working with export to either Python or JavaScript?

@corevo
Copy link
Member Author

corevo commented Feb 28, 2019

Please refer to #592 for future information.

@corevo corevo closed this as completed Feb 28, 2019
@corevo corevo unpinned this issue Feb 28, 2019
@lm-ahmedgehad
Copy link

@edpichler We didn't remove it. We just didn't port everything from the legacy Selenium IDE. We're actively working on building reliable and maintainable features for the community. Code export is coming soon. We appreciate your patience, and welcome any contributions if you want to chip in and help out.

so when are you planning to release it?

@tourdedave
Copy link

@lm-ahmedgehad You can follow along with the progress of code export here. The timeline is unknown since this is an open-source project. If you want to run your tests in parallel and integrate them with CI, then you can always checkout the command-line runner (link).

@lock lock bot locked and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests