GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 651 of 677    Print  
Regular expressions for web testing
Browser("Yahoo! Mail: The best").Page("(2 unread) Yahoo! Mail").Link("Inbox (2)").Click

this is the recorded script i get after performing the action on yahoo mail..now when i run the test again ...the page title and link name changes as the no. of emails in inbox increases...so the error says cannot find the object.

can someone please tell me what regular expressions i should used for this script ?



  
Total Answers and Comments: 4 Last Update: July 05, 2008     Asked by: anushankar 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 04, 2008 06:32:09   #1  
ramupalanki Member Since: December 2007   Contribution: 10    

RE: Regular expressions for web testing
Use the following code which suites your inquiries


Browser("title:=.*Yahoo!.*").Page(".*Yahoo!.*").Link("Inbox.*").Click

Try this and let me know if it executed properly


Ramu

 
Is this answer useful? Yes | No
June 12, 2008 16:51:12   #2  
atdhdrolla Member Since: March 2007   Contribution: 19    

RE: Regular expressions for web testing
Please use descriptive programming laguage. Your code should look like something as below

Browser("name:=.*Yahoo!.*","title:=.*Yahoo!.*").Page("title:=.*Yahoo!.*").WebTable("name:=login").WebEdit("name:=login").Set "XYZ"

Use object spy tool in QTP to learn the properties of the object and use them in desciptive language. I hope it should help you

 
Is this answer useful? Yes | No
July 03, 2008 02:22:32   #3  
krishna1978 Member Since: July 2008   Contribution: 4    

RE: Regular expressions for web testing
Instead of "2 unread", you can regularise the option with a regular expression as [0-9]* in the palce of 2 and do not forget to check the regular expression check box.
 
Is this answer useful? Yes | No
July 05, 2008 00:15:27   #4  
Padmanaban_hsui Member Since: July 2008   Contribution: 1    

RE: Regular expressions for web testing
Browser("Yahoo! Mail: The best").Page("(2 unread) Yahoo! Mail").Link("Inbox (2)").

we can resolve this issue by Regular Expresions. In the Object Repository change the Value of the object using .* and save the change in the Object Repository.

eg) Page("(2 unread) Yahoo! Mail") --> instead of this (2 unread) Yahoo! Mail) object change the object to a common name wih .*

this can be handled even using Descriptive Programming by give the Value of a unique property in the Code itself

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape