Comparison of two values in a webpage using selenium webdriver

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Comparison of two values in a webpage using selenium webdriver

yarlagadda ramya
Hi all,

Am using selenium Webdriver and running it as Java Application for automating my application.

Was stuck in an issue where I have to compare two values in one webpage and throwing an error if they are different.

Can any one please let me know how can I resolve this issue.

Thanks & Regards
Ramya

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3695c981-0bf2-4062-b371-7f11b7df2dfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Comparison of two values in a webpage using selenium webdriver

UmaMahesh
if you write the story, it is difficult to analyze the users.

for better answer, you need to paste the source code and your script.


WebElement str1= driver.findelement(by.xpath("xxxxxxxxxxxxxxxx").gettext();

WebElement str2= driver.findelement(by.xpath("xxxxxxxxxxx").gettext();

if (str1.equals.str2){
}else{
}

On Sat, Sep 27, 2014 at 9:58 PM, yarlagadda ramya <[hidden email]> wrote:
Hi all,

Am using selenium Webdriver and running it as Java Application for automating my application.

Was stuck in an issue where I have to compare two values in one webpage and throwing an error if they are different.

Can any one please let me know how can I resolve this issue.

Thanks & Regards
Ramya

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3695c981-0bf2-4062-b371-7f11b7df2dfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
mahesh.......

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAPz6rZXZFMb20TbSyPzcH%3DARg22hYgy9%3DnOiRt62nov689H%3Dig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Comparison of two values in a webpage using selenium webdriver

Mukesh otwani
In reply to this post by yarlagadda ramya
Hi Ramya,

If you are using testng I will suggest use Assert class that will compare values

here is the code

Assert.assertEquals(actual,expected)

On Saturday, September 27, 2014 9:58:48 PM UTC+5:30, yarlagadda ramya wrote:
Hi all,

Am using selenium Webdriver and running it as Java Application for automating my application.

Was stuck in an issue where I have to compare two values in one webpage and throwing an error if they are different.

Can any one please let me know how can I resolve this issue.

Thanks & Regards
Ramya

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/aea94c5d-72ba-4f17-baa9-66e91bbd4423%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Comparison of two values in a webpage using selenium webdriver

teja vallu
Hi mukesh,

How to compare 2 pages in one webapplication
i need to compare 2 pages in my application,but here getTitle() and getCurrentUrl() are same in both pages,then how can i compare
can you please help me in this.?

On Monday, September 29, 2014 at 5:16:15 AM UTC+10, Mukesh otwani wrote:
Hi Ramya,

If you are using testng I will suggest use Assert class that will compare values

here is the code

Assert.assertEquals(actual,expected)

On Saturday, September 27, 2014 9:58:48 PM UTC+5:30, yarlagadda ramya wrote:
Hi all,

Am using selenium Webdriver and running it as Java Application for automating my application.

Was stuck in an issue where I have to compare two values in one webpage and throwing an error if they are different.

Can any one please let me know how can I resolve this issue.

Thanks & Regards
Ramya

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/04c3d4a4-e38e-4c90-b5c4-2be0aebb7b04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.