vmi / selenese-runner-java

Selenium IDE native format (selenese and side) interpreter.
Other
141 stars 83 forks source link

Question: Data-Driven in selenese-runner-java #225

Open reegen opened 7 years ago

reegen commented 7 years ago

Hi,

Is it possible to configure data-driven in selenese-runner-java tests?

vmi commented 7 years ago

What is "Data-Driven"? Is it the following one? http://toolsqa.com/selenium-webdriver/data-driven-testing-excel-poi/

reegen commented 7 years ago

Yes, that's it. Data-driven testing means by using a single test to verify many different test cases by driving the test with input and expected values from an external data source instead of using the same hard-coded values each time the test runs.

Selenium IDE does not have in-built features to create data-driven tests. We can do data driven tests with Selenium IDE only by using some user extension or add-on. And the most popular add-on for doing this, as far as I know, is that one called 'SelBlocks'.

Recently, I saw that the SelBlocks creator implemented the feature that makes possible to add SelBlocks as user-extensions.js to selenium-server, and so that Selenese scripts that use SelBlocks commands could also be run in Selenium Server via the -user-extensions and -htmlSuite options: https://github.com/refactoror/SelBlocks/issues/10

Unfortunatly, that feature is currently with a bug: http://refactoror.wikia.com/wiki/Selblocks_Reference

It would be really nice and useful if selenese-runner-java had that feature.

reegen commented 7 years ago

Examples of data-driven using Selenium IDE and Selblocks: https://whereiskieran.com/2015/09/15/selenium-xml-data-driven-testing-sounds-harder-than-it-is/ http://cubettech.com/blog/how-to-do-data-driven-testing-using-selenium-ide/

Another approaches: http://seleniumworks.blogspot.com.br/2014/01/selenium-ide-data-driven.html http://stackoverflow.com/questions/19250176/how-can-i-read-variables-from-data-pool-with-selenium-ide

By the way, I think this topic is related to that: https://github.com/vmi/selenese-runner-java/issues/79

vmi commented 7 years ago

Thank you for the information. Currently, there is no feature to do "Data-Driven", but I will consider to implementing it. However, it will take a lot of time for that work, so please be patient.

reegen commented 7 years ago

Thank you for the quick answer! So I will look forward to its implementation. And don't worry, take your time. I'm sure you guys will do a good job.

reegen commented 7 years ago

Hi @vmi,

I've just realized that SRV already has commands of flow control as a feature (https://github.com/davehunt/selenium-ide-flowcontrol).

So, I was wondering that to get full data-driven in SRJ would be enough to implement simple commands to load and read a CSV file for input (at least as a starting point; after that, of course, you could implement the same feature to XML and XLS files, for example, if you want).

I discovered that the code for such functionality already exists: https://github.com/abhijain2618/csvreader/blob/master/CSVRead_Selenium-IDE.js

Examples of use: http://openselenium.com/?p=19 http://sqa.stackexchange.com/questions/14684/can-i-copy-data-from-a-csv-file-and-use-it-in-a-website-using-only-selenium-ide https://bashamy.blogspot.com.br/2016/01/selenium-ide-to-use-while-loop-and-read.html

And I think that implementing this would take a little less time that implementing the whole SelBlocks user extension, don't you think? ;-)

vmi commented 7 years ago

It is technically a good way. However, there are some problems to introduce it, so I will consider a better way.

gbennett-manh commented 7 years ago

VMI -

How do I extend Selenese runner to use firefox extensions?

I am doing data-driven scripts in IDE using all the SeLite plugins by Peter Kehl a extension called CSV Reader. It works really well.

Now I am trying to get these scripts to run automatically and have been beating my head against a wall with HTML-Runner when I found your selenese-runner.

How do you include extensions to the browser? Do you have any examples?

Thanks in advance for any help.

Gina