selenium-ide icon indicating copy to clipboard operation
selenium-ide copied to clipboard

Feature question - data driven testing

Open QA1MTG opened this issue 8 years ago • 32 comments

Is there ability in the new IDE to load data from excel spreadsheets and use the values in the test?

QA1MTG avatar May 03 '18 15:05 QA1MTG

i'm also interested in this feature. i'd be fine with the data being csv or json.

@corevo i can help build this feature.

jesg avatar May 03 '18 15:05 jesg

Currently I have a mechanism that was built in the user-extension.js to do data driven based on loading an XML file. Since user-extension isn't available, if there's an easier way to do via Excel/CSV/Json that would be really helpful.

QA1MTG avatar May 03 '18 15:05 QA1MTG

This is quite challenging, the main issue is, that browser vendors (i.e. Mozilla & Google) don't let extensions access your filesystem anymore, meaning I can't read or write files unless you open them through dialog, or download them.
The problem is that if you're using a csv file, it would be a bit frustrating, having to open a dialog and navigate to it every time you open the test case.
Also since we don't have filesystem we can't reliably fetch it when it is ran from command line.

We'll have to think of a clever, and good way (in terms of ux) to do it, atm I don't have a good solution for it.

corevo avatar May 03 '18 15:05 corevo

from a UX perspective, what if you added a tab next to log and had the file with the data display? maybe it's a plugin that allows you to view excel files/csv/xml?

would it be easier to have the file type be a google spreadsheet full of data? this way it's not an external file?

I could see issues if it's data that needs to be confidential

QA1MTG avatar May 03 '18 16:05 QA1MTG

i'd be fine with uploading the data once and not being able to modify the data. or i'd be fine with fetching the data from a url though that seems more complicated.

for a comparison i think kantu lets the user upload a csv file.

jesg avatar May 03 '18 16:05 jesg

How about reading data, storing screenshots from Dropbox or similar?

-OR-

Just add url handler to website to get/put data?

On Thu, May 3, 2018, 11:14 AM jesg [email protected] wrote:

i'd be fine with uploading the data once and not being able to modify the data. or i'd be fine with fetching the data from a url though that seems more complicated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SeleniumHQ/selenium-ide/issues/183#issuecomment-386350926, or mute the thread https://github.com/notifications/unsubscribe-auth/AAvMbETENYVZr6SqgXYQtDTJXuLO-Oegks5tuy0BgaJpZM4TxTXw .

treg avatar May 03 '18 16:05 treg

@corevo shouldn't we be able to store large blobs with the file system api (non-standard) which provides a sandboxed filesystem. or we could use indexedDB which is standard.

where does the project state get stored? i was not able to figure this out though it looks like reactjs reacts when the mutation property is modified.

jesg avatar May 03 '18 20:05 jesg

@QA1MTG I don't like that idea, it will make the IDE a spreadsheet editor as well, which will never be as good as any other product on the market today.

@treg I thought back in the day about downloading through static websites, but that would put your data at risk, as it will be public accessible, unless you host it on localhost, or we provide integration with different services.

@jesg Uploading once is a bad idea, because soon you'll forget what data was there. fs api, is only partially available on ff, but in any case if we use either fs api or indexDB, the test case will not be portable from machine to machine.
At the end all the data needs to be stored in the side file, and I really don't want to add any more attachments to it, as it'll make it hard to maintain.

corevo avatar May 04 '18 06:05 corevo

@corevo I see your point, although I was only thinking of the spreadsheet viewer to be read only data, and not an editor. Just having the ability to see the data that the test is using. Any manual updates would be in the spreadsheet and loaded again if changes are necessary.

QA1MTG avatar May 04 '18 14:05 QA1MTG

@corevo i disagree with your concerns about @treg's proposal. most corporate organizations are on a vpn so this isn't as big of an issue as you are making it.

jesg avatar May 04 '18 14:05 jesg

@jesg even if you're using a vpn, the IDE isn't built for corporate organizations alone.
We needs to provide a solution that would keep the data safe, both for organizations and individuals.
Don't get me wrong, I want this feature to be implemented, but it needs to be done in a right way.
EDIT: also I'd like to support saving that info in source control if possible

corevo avatar May 04 '18 16:05 corevo

Since you are building a plug-in module, Could the data be loaded from there?

On Fri, May 4, 2018, 11:04 AM Tomer Steinfeld [email protected] wrote:

@jesg https://github.com/jesg even if you're using a vpn, the IDE isn't built for corporate organizations alone. We needs to provide a solution that would keep the data safe, both for organizations and individuals. Don't get me wrong, I want this feature to be implemented, but it needs to be done in a right way.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SeleniumHQ/selenium-ide/issues/183#issuecomment-386647882, or mute the thread https://github.com/notifications/unsubscribe-auth/AAvMbMwPA609H7ssPdhWlcXCqVZ5YX7fks5tvHwWgaJpZM4TxTXw .

treg avatar May 04 '18 16:05 treg

Not exactly, any plugin built is subject to the same limitation any other extension has.
Meaning if you plan on doing that using a plugin, that plugin will face the same difficulties the IDE has.

corevo avatar May 04 '18 16:05 corevo

I guess what I was thinking is to build a plug-in with hardcoded test data and using that within the IDE..

On Fri, May 4, 2018, 11:13 AM Tomer Steinfeld [email protected] wrote:

Not exactly, any plugin built is subject to the same limitation any other extension has. Meaning if you plan on doing that using a plugin, that plugin will face the same difficulties the IDE has.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SeleniumHQ/selenium-ide/issues/183#issuecomment-386650274, or mute the thread https://github.com/notifications/unsubscribe-auth/AAvMbIf2GLdGvWRWY2bMh8DGjqkleEU5ks5tvH4ZgaJpZM4TxTXw .

treg avatar May 04 '18 16:05 treg

We could make it work, it's not part of the current plugin system, and we have to find a way to give plugins the correct API calls to enable that.
Although I would like to find a solution that would work natively in the IDE.

corevo avatar May 06 '18 07:05 corevo

@tourdedave Is this enhancement prioritized yet for design and development?

testanalyst avatar Mar 29 '19 09:03 testanalyst

No, but I started working on it in my spare time to demonstrate how plugins could enable this.

I have a PR that needs some work to add functionality in control flow and the plugins API (link) and I have a plugin that can be used to upload a CSV and pass it to the IDE (link). You can see a demo of it in action here.

As I mentioned, there's still work to be done. Not sure when it will land yet. I'll post here when something is available.

tourdedave avatar Mar 31 '19 07:03 tourdedave

No, but I started working on it in my spare time to demonstrate how plugins could enable this.

I have a PR that needs some work to add functionality in control flow and the plugins API (link) and I have a plugin that can be used to upload a CSV and pass it to the IDE (link). You can see a demo of it in action here.

As I mentioned, there's still work to be done. Not sure when it will land yet. I'll post here when something is available.

@tourdedave, the video just demonstrates how a plugin could work by providing the data driven capabilites to the Selenium IDE, right? The repository plugin is not yet functional, correct?

myronrezzo avatar Jun 02 '19 20:06 myronrezzo

@myronrezzo It's functional.

I released the plugin changes necessary for it last month. If you upload a CSV file with the file uploader, it will get parsed, its contents sent to Selenium IDE, and stored in a variable called fileContents. From there you can use forEach to iterate it.

Here's an example project file that demonstrates it: data-driven.side.zip.

tourdedave avatar Jun 03 '19 11:06 tourdedave

Hi @tourdedave , would you be able to send me the csv file that goes along with the project as well? Is it literally a column with username and a column for password?

p2635 avatar Jun 07 '19 11:06 p2635