- rohit kumar guptaActive particpant
- Posts : 24
Join date : 2012-09-19
Age : 34
Location : abc
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?
- rohit kumar guptaActive particpant
- Posts : 24
Join date : 2012-09-19
Age : 34
Location : abc
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
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.
Not quite sure where the highlighted text is in you html snippet.
- rohit kumar guptaActive particpant
- Posts : 24
Join date : 2012-09-19
Age : 34
Location : abc
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.....
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.....
- text verification
- Command for auto populated text verification.
- How to get the tittle of a object (not window), bcz title holds the full text but inner text holds only 25 char of text (in RC and Webdriver)
- Selenium Automatically clears the text entered in text box-Dynamic Web Table(dgrid)
- Dynamic webelement verification
Permissions in this forum:
You cannot reply to topics in this forum