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
rohit kumar gupta
Active particpant
Active particpant
Posts : 24
Join date : 2012-09-19
Age : 34
Location : abc

Text verification Empty Text verification

Wed Nov 28, 2012 10:24 pm
In order to verify text present on the screen instead of using getText() in Assert isnt there any method wherein we can pass the text as input and test the presence of webelement?
avatar
rohit kumar gupta
Active particpant
Active particpant
Posts : 24
Join date : 2012-09-19
Age : 34
Location : abc

Text verification Empty Re: Text verification

Thu Nov 29, 2012 11:21 am
Code:





<html>


<head>

<body vlink="#666666" link="#000099" bgcolor="#FFFFFF">


<div>


<table height="100%" cellspacing="0" cellpadding="0" border="0">


<tbody>


<tr>


<td valign="top" bgcolor="#003366">

<td valign="top">


<table cellspacing="0" cellpadding="0" border="0">


<tbody>


<tr>

<tr>

<tr>

<tr>


<td>


<table cellspacing="0" cellpadding="0" border="0">


<tbody>


<tr>


<td width="14">
               
              </td>

<td>


<table width="492" cellspacing="0" cellpadding="0" border="0">


<tbody>


<tr>

<tr>

<tr>


<td>


<font size="2" face="Arial, Helvetica, sans-serif">[b][font=Arial Black]Use our Flight Finder
      to search for the lowest fare on participating airlines. Once you've booked
      your flight, don't forget to visit the Mercury Tours Hotel Finder to reserve
      lodging in your destination city.[/font][/b]</font>
</td>
</tr>

<tr>

<tr>


<td>


<form name="findflight" action="mercuryreservation2.php" method="post">


<table width="100%" cellpadding="2" border="0">


<tbody>


<tr>

<tr>


<td width="33%" align="right">

<td width="67%">


<b>


<font size="2" face="Arial, Helvetica, sans-serif">


<input type="radio" checked="" value="roundtrip" name="tripType">

              Round Trip 
             

<input type="radio" value="oneway" name="tripType">

              One Way
</font>
</b>
</td>
</tr>

<tr>

<tr>

<tr>

<tr>

<tr>

<tr>

<tr>

<tr>

<tr>

<tr bgcolor="#CCCCCC">

<tr>

<tr>
</tbody>
</table>
</form>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>

<tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

The text highlighted in red is what i want to verify ... plz suggest


Last edited by rohit kumar gupta on Fri Nov 30, 2012 12:09 pm; edited 1 time in total
avatar
tarun3kumar
Master
Master
Posts : 186
Join date : 2012-02-14
http://seleniumtests.com

Text verification Empty Re: Text verification

Fri Nov 30, 2012 10:09 am
You can use xPath to create element locator using text and verify its presence.
Not quite sure where the highlighted text is in you html snippet.
avatar
rohit kumar gupta
Active particpant
Active particpant
Posts : 24
Join date : 2012-09-19
Age : 34
Location : abc

Text verification Empty Re: Text verification

Fri Nov 30, 2012 12:16 pm
Hi Tarun,




Use our Flight Finder
to search for the lowest fare on participating airlines. Once you've booked your flight, don't forget to visit the Mercury Tours Hotel Finder to reserve lodging in your destination city.[/font][/b]



I wanted to verify the text "use..... city."...
Note:- I tried this:-
//b/font/font[contains(.,'Preferences')]
//font[text()='Preferences']
both worked...to identify the preferences text on page.
But when i replace with the text above i am getting no match found in firepath.
Has it got anything to do with space . or '.....Plz advice.....
Sponsored content

Text verification Empty Re: Text verification

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