Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
rajareddy
Active particpant
Active particpant
Posts : 11
Join date : 2012-06-07

How to compare two stored variable values in Selenium IDE Empty How to compare two stored variable values in Selenium IDE

Tue Jun 12, 2012 1:40 pm
Hi,

Could you please help me how to compare two stored variable values in Selenium IDE

I have used "StoreText" and "Echo" commands and stored the values of a variable/element from two different URLs But I am unable to compare whether the value for that element in both the sites is same or not?. So please help me out of this.

Thanks,

Raja Reddy
rohit13
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 37
Location : INDIA
http://radical-qa.blogspot.in/

How to compare two stored variable values in Selenium IDE Empty Re: How to compare two stored variable values in Selenium IDE

Tue Jun 12, 2012 2:27 pm
Below is sample code for comparison
Code:
store  |    https://www.google.co.in/  |  base
storeLocation  |  base2
gotoIf  |  storedVars['base']==storedVars['base2']  |  true
getEval  |  alert("Not Matching")
gotolabel  |  finish
label  |  true
getEval  |  alert("Matching")
label  |  finish
avatar
rajareddy
Active particpant
Active particpant
Posts : 11
Join date : 2012-06-07

How to compare two stored variable values in Selenium IDE Empty How to compare two stored variable values in Selenium IDE

Tue Jun 12, 2012 3:51 pm
Hi,

I have tried doing with the code that you have given, but I am unable to find "gotoIf" command and getting "Unknown Command" exception. So please find attached the screen shots for the same and kindly help me out of this issue.

Thanks,
Raja Reddy
rohit13
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 37
Location : INDIA
http://radical-qa.blogspot.in/

How to compare two stored variable values in Selenium IDE Empty Re: How to compare two stored variable values in Selenium IDE

Tue Jun 12, 2012 4:02 pm
ohh..actually selenium IDE doesn't support this command directly,
you need to add user extension for it - goto_sel_ide.js
http://wiki.openqa.org/pages/viewpageattachments.action?pageId=379&metadataLink=true
You download it from above link.
For reference go to - http://radical-qa.blogspot.in/2012/02/selenium-ide_09.html
avatar
rajareddy
Active particpant
Active particpant
Posts : 11
Join date : 2012-06-07

How to compare two stored variable values in Selenium IDE Empty How to compare two stored variable values in Selenium IDE

Tue Jun 12, 2012 7:11 pm
Hi,

Thank you so much.........!

Now I am able to use "gotoIf", but I am unable to use "getEval", so please help me out saying how can i get this please.

Is there any other user extensions that I have to upload, if yes can you please help me where can i get those.

Thanks,
Raja Reddy
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

How to compare two stored variable values in Selenium IDE Empty Re: How to compare two stored variable values in Selenium IDE

Wed Jun 13, 2012 5:16 am
getEval doesn't auto-complete for some reason in the command field. Just type it in. Selenium should recognize it that way

If this doesn't work, what error are you getting?
avatar
rajareddy
Active particpant
Active particpant
Posts : 11
Join date : 2012-06-07

How to compare two stored variable values in Selenium IDE Empty How to compare two stored variable values in Selenium IDE

Wed Jun 13, 2012 12:17 pm
Hi,

Thank you so much........ I am not getting any error on using "getEval" manually.But even though the values of stored variable "a" and stored variable "b" is not same it is showing as "Matching". So please kindly help me out from this issue. for your reference please find the attached screen shots.

Thanks,
Raja Reddy
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

How to compare two stored variable values in Selenium IDE Empty Re: How to compare two stored variable values in Selenium IDE

Thu Jun 14, 2012 3:17 am
Where are the screen shots?

try using:
echo | ${a}
echo | ${b}

I suspect the store command you are using may be storing if that link is present as opposed to the actual value. If this is the case, both "a" and "b" will be "true"
avatar
rajareddy
Active particpant
Active particpant
Posts : 11
Join date : 2012-06-07

How to compare two stored variable values in Selenium IDE Empty How to compare two stored variable values in Selenium IDE

Thu Jun 14, 2012 1:21 pm
Hi,

Thank you so much..... It's working great with "echo" command. But instead of getting an alert I have to save/print the a, b and comparison result to an Excel Sheet. So please kindly help me saying how to save the values to an Excel sheet using Selenium IDE please.

Thanks,
Raja Reddy
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

How to compare two stored variable values in Selenium IDE Empty Re: How to compare two stored variable values in Selenium IDE

Fri Jun 15, 2012 4:36 am
This is not supported functionality in Selenium IDE. You would have to use RC or Webdriver.
avatar
epivnik
Posts : 2
Join date : 2013-02-01

How to compare two stored variable values in Selenium IDE Empty Re: How to compare two stored variable values in Selenium IDE

Fri Feb 01, 2013 2:45 am
In the IDE I would do something like this.....

# check if 2 variables are equal

storeEval | javascript{ storedVars['a'] == storedVars['b'] | c
echo | ${c}
avatar
Nevermind
Posts : 1
Join date : 2013-02-22

How to compare two stored variable values in Selenium IDE Empty Re: How to compare two stored variable values in Selenium IDE

Fri Feb 22, 2013 12:40 pm
assertEval can be used to compare strings

assertEval | storedVars['a'] == storedVars['b'] | true
Sponsored content

How to compare two stored variable values in Selenium IDE Empty Re: How to compare two stored variable values in Selenium IDE

Back to top
Permissions in this forum:
You cannot reply to topics in this forum