Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How to compare two stored variable values in Selenium IDE

View previous topic View next topic Go down

How to compare two stored variable values in Selenium IDE

Post by rajareddy on 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

rajareddy
Active particpant
Active particpant

Posts : 11
Join date : 2012-06-07

Back to top Go down

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

Post by rohit13 on 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

_________________
Radical QA
http://radical-qa.blogspot.in/

rohit13
Master
Master

Posts : 180
Join date : 2012-03-29
Age : 30
Location : INDIA

http://radical-qa.blogspot.in/

Back to top Go down

How to compare two stored variable values in Selenium IDE

Post by rajareddy on 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

rajareddy
Active particpant
Active particpant

Posts : 11
Join date : 2012-06-07

Back to top Go down

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

Post by rohit13 on 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

_________________
Radical QA
http://radical-qa.blogspot.in/

rohit13
Master
Master

Posts : 180
Join date : 2012-03-29
Age : 30
Location : INDIA

http://radical-qa.blogspot.in/

Back to top Go down

How to compare two stored variable values in Selenium IDE

Post by rajareddy on 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

rajareddy
Active particpant
Active particpant

Posts : 11
Join date : 2012-06-07

Back to top Go down

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

Post by ccox on 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?

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

How to compare two stored variable values in Selenium IDE

Post by rajareddy on 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

rajareddy
Active particpant
Active particpant

Posts : 11
Join date : 2012-06-07

Back to top Go down

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

Post by ccox on 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"

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

How to compare two stored variable values in Selenium IDE

Post by rajareddy on 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

rajareddy
Active particpant
Active particpant

Posts : 11
Join date : 2012-06-07

Back to top Go down

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

Post by ccox on Fri Jun 15, 2012 4:36 am

This is not supported functionality in Selenium IDE. You would have to use RC or Webdriver.

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

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

Post by epivnik on 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}

epivnik

Posts : 2
Join date : 2013-02-01

Back to top Go down

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

Post by Nevermind on Fri Feb 22, 2013 12:40 pm

assertEval can be used to compare strings

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

Nevermind

Posts : 1
Join date : 2013-02-22

Back to top Go down

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

Post by Sponsored content Today at 1:55 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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