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

Missing features, Flow Control and Store Variables

Open babuto00 opened this issue 8 years ago • 33 comments

Hello, first of all, thank you for your wonderful work! However what I miss are functions I used from Flow Control and Store Variable plugins in former Selenium IDE in FF. Would it be possible to include such functions in the new version? Without any using any plugins, I believe a lot of users would appreciate it. Thank you!

babuto00 avatar Feb 19 '18 09:02 babuto00

Yes, we plan on bringing these features built in the IDE

Cheers, Tom

On 19 Feb 2018, 11:53 +0200, babuto00 [email protected], wrote:

Hello, first of all, thank you for your wonderful work! However what I miss are functions I used from Flow Control and Store Variable plugins in former Selenium IDE in FF. Would it be possible to include such functions in the new version? Without any using any plugins, I believe a lot of users would appreciate it. Thank you! — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

corevo avatar Feb 19 '18 09:02 corevo

@babuto00 do you have a link for "Flow Control"? I'm not familiar with that one.

bryanl-csi avatar Feb 21 '18 14:02 bryanl-csi

I am not babuto00, but I guess he refers to this Firefox addon, which added flow control commands like gotoif, gotolabel and while to the old IDE.

There is also new Kantu IDE, and it already supports flow control in Chrome:
https://a9t9.com/kantu/docs/webextensions/selenium-ide#flowcontrol

idefix1 avatar Feb 21 '18 15:02 idefix1

Thanks!

Kind of surprised I never used that one.

bryanl-csi avatar Feb 21 '18 16:02 bryanl-csi

Yeah, it's that firefox addon idefix1 linked. It was pretty useful. Sorry for late response

babuto00 avatar Feb 21 '18 17:02 babuto00

are there also plans for the commands: for and forxml??

setiseta avatar Feb 28 '18 09:02 setiseta

for will be added, along side while,
forXml is a bit problematic, because it can read your filesystem, which is a bit of a security risk.
We'll have to take a look on how we can do this, while keeping our security policy as permissive as possible.

corevo avatar Feb 28 '18 09:02 corevo

thanks, sounds good. yes filesystem is a bit critical. at the moment i don't use forxml, but for.

setiseta avatar Feb 28 '18 09:02 setiseta

Just dropping an update on our current thoughts,
We're going to add the following commands:

  • if else end
  • while do end

We'll need to give for a bit more thought before we implement it (UI terms mostly). UPDATE: We will add times which will cover most of for's use cases atm

We're looking for a way to migrate the unstructured old flow control. (e.g. goto gotoIf label etc...)

corevo avatar Apr 02 '18 08:04 corevo

Do Store Variable controls include in #140 too? For example, getEval, storeEval etc..

Jongkeun avatar Apr 17 '18 02:04 Jongkeun

eval is a bit of a problem, but if also evals the target.
It's a problem we'll have to address, I don't know how, and I'm not sure whats gonna be the scope of the eval.
If we want a safer eval, we'll have to eval in an isolated environment, which means that storeEval and the likes are useless, since there is no access to the DOM.
But it might be enough for ifs.

corevo avatar Apr 17 '18 06:04 corevo

Why do you think eval's scope has a problem? About security?

Jongkeun avatar Apr 25 '18 09:04 Jongkeun

Yes, say we let you eval in the extensions scope, you can get the entire DOM as text.
And if we let you eval in the content side of things, you can add a keylogger to the tab.
The problem is that the only thing that stops a user from evaling something dangerous, is his responsibility to check what it does.
There are a lot of blogs that tell you, add this core extension to your IDE and it'll do magic for you, these kind of features are things that vendors (specifically Mozilla), won't stand for.
We have already been asked to remove all usage of eval in the extension.

corevo avatar Apr 26 '18 11:04 corevo

Hello, just checking in to see if there is any progress relating to the flow control (while command etc.)? Thank you!

babuto00 avatar May 02 '18 12:05 babuto00

Not at the moment, its best to follow the pr.
The work is spread across 3 big features we want to ship very soon, control flow, running projects from cli and plugins for the IDE.

corevo avatar May 02 '18 12:05 corevo

I have been trying out the new execute script functionality as well as an if statement but can't get the if statement to work with a variable.

In the scenario below, "site" is schoolsdev.

Am I not using the if statement correct as it always goes to the else statement unless I use a schoolsdev in the if statement.

execute script | return window.document.domain | host execute script | return "${host}".slice(0, 10) | site if | "${site}"=="schoolsdev"

hohnan avatar Aug 13 '18 21:08 hohnan

@hohnan: I pushed a fix for this in d93332487a3039605214a13c32030f1f3292d7d9. It will go out in a release later today.

tourdedave avatar Aug 14 '18 15:08 tourdedave

@tourdedave: So far so good. Thanks for the quick turn around on that one!!!!

hohnan avatar Aug 15 '18 12:08 hohnan

You're welcome!

tourdedave avatar Aug 15 '18 12:08 tourdedave

Can we close this, now that we have control flow and executeScript?

corevo avatar Aug 21 '18 07:08 corevo