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

Support ECMAScript 6 Template Literals #1662

Closed
peter-lyons-kehl opened this issue Feb 18, 2016 · 3 comments
Closed

Support ECMAScript 6 Template Literals #1662

peter-lyons-kehl opened this issue Feb 18, 2016 · 3 comments
Labels

Comments

@peter-lyons-kehl
Copy link

With Selenium IDE 2.9.1 and current Firefox (44),

 `...${javascript-expression}...`

in Selenese command parameters (target or value) should evaluate javascript expression as per ECMAScript 6 template literals. Hence, within template literals

 `...`

Selenium shouldn't replace ${...} with values of any stored variables.

getEval | friend='John'
storeEval | 'Max' | friend
getEval | alert( `Hello ${friend}.` )

or (more 'real'):

storeEval | 'Max' | friend
....
getEval | var friend='John'; alert( `Hello ${friend}.` )

Expected behavior

--> Hello John.

Actual Behavior

--> Hello Max.

Fix, related Selenese docs and ES6 specification

Modify Selenium.prototype.replaceVariables() as per its override in https://github.com/SeLite/SelBlocksGlobal/blob/master/sel-blocks-fx_xpi/chrome/content/extensions/selblocks.js.

@jleyba jleyba added the C-ide label Feb 21, 2016
@samitbadle
Copy link
Contributor

Hi Peter,

The stored variables in Selenium existed way before ES6 and as far as I know are actively being used in tests. Changing the way it works, while very nice to have, would lead to test breakages. Also remember that stored variables are a bit separate from variables created by a web page loaded JavaScript to avoid name clashes.

So this one I am afraid would be won't fix.
Cheers,
Samit

On 18 Feb 2016, at 06:02, Peter Kehl notifications@github.com wrote:

With Selenium IDE 2.9.1 and current Firefox (44), ..${javascript-expression}... should evaluate javascript expression as per ECMAScript 6 template literals. Hence, it shouldn't replace ${...} with values of any stored variables.

getEval | friend='John'
storeEval | 'Max' | friend
getEval | alert( Hello ${friend}. )

or (more 'real'):

storeEval | 'Max' | friend
....
getEval | var friend='John'; alert( Hello ${friend}. )

Expected behavior

--> Hello John.

Actual Behavior

--> Hello Max.

Fix, related Selenese docs and ES6 specification

Modify Selenium.prototype.replaceVariables() as per its override in https://github.com/SeLite/SelBlocksGlobal/blob/master/sel-blocks-fx_xpi/chrome/content/extensions/selblocks.js.


Reply to this email directly or view it on GitHub.

@peter-lyons-kehl
Copy link
Author

Samit,

As demonstrated in the above example, and in the referenced source code that shows an implementation of this change, this would only affect Selenese parameters that contain ${...} between a pair of back apostrophes ``....

I doubt that many (if any) existing real world test cases would have that - since back apostrophe is highly uncomon. Hence I suggest to re-consider this ticket for the benefit of more flexibility.

(Side note: I know the difference b/w Selenese stored vars and JS vars. The above example depends on that difference.)

@barancev
Copy link
Member

Selenium IDE development has been discontinued. No more new features and no bug fixes. From Firefox 55 onwards, Selenium IDE will no longer work [1]. The last supported version is Firefox ESR 52.

Yes, we've started a project to develop a new tool that should replace Selenium IDE. Follow #4406 for the progress.

Sorry this issue has not beed properly and timely addressed, and thank you for submission!

[1] https://seleniumhq.wordpress.com/2017/08/09/firefox-55-and-selenium-ide/

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

No branches or pull requests

4 participants