Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

» Selenium Webdriver
Sat Feb 04, 2017 6:47 pm by soumyamishrav@gmail.com

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Text verification

View previous topic View next topic Go down

Text verification

Post by rohit kumar gupta on 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 gupta
Active particpant
Active particpant

Posts : 24
Join date : 2012-09-19
Age : 27
Location : abc

Back to top Go down

Re: Text verification

Post by rohit kumar gupta on 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

rohit kumar gupta
Active particpant
Active particpant

Posts : 24
Join date : 2012-09-19
Age : 27
Location : abc

Back to top Go down

Re: Text verification

Post by tarun3kumar on 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.

_________________
Thanks
Tarun K
Free Selenium Training

tarun3kumar
Master
Master

Posts : 186
Join date : 2012-02-14

http://seleniumtests.com

Back to top Go down

Re: Text verification

Post by rohit kumar gupta on 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.....

rohit kumar gupta
Active particpant
Active particpant

Posts : 24
Join date : 2012-09-19
Age : 27
Location : abc

Back to top Go down

Re: Text verification

Post by Sponsored content


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