Comparison of two values in a webpage using selenium webdriver

瀏覽次數:903 次
跳到第一則未讀訊息

yarlagadda ramya

未讀,
2014年9月27日 中午12:28:482014/9/27
收件者:seleniu...@googlegroups.com
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

UmaMahesh

未讀,
2014年9月28日 上午10:41:092014/9/28
收件者:seleniu...@googlegroups.com
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{
}

--
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 selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
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.......

Mukesh otwani

未讀,
2014年9月28日 下午3:16:152014/9/28
收件者:seleniu...@googlegroups.com
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)

teja vallu

未讀,
2017年6月6日 晚上11:44:532017/6/6
收件者:Selenium Users
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.?
回覆所有人
回覆作者
轉寄
0 則新訊息