what is regular expression how will you implement it?

Answer Posted / srinivas

Let us take yahoo! site as an example. Then the script will
be something like:

===========================================================
Browser("Yahoo! Mail - The best").Page("Yahoo! Mail - The
best").WebEdit("login").Set "TestUser"
Browser("Yahoo! Mail - The best").Page("Yahoo! Mail - The
best").WebEdit("passwd").SetSecure "460205b87f0543"
Browser("Yahoo! Mail - The best").Page("Yahoo! Mail - The
best").WebButton("Sign In").Click
Browser("Yahoo! Mail - The best").Page("Yahoo! Mail -
TestUser@").Link("Addresses").Click
Browser("Yahoo! Mail - The best").Page("Yahoo! Address
Book -").Link("Mail").Click
Browser("Yahoo! Mail - The best").Page("Yahoo! Mail -
TestUser").Sync
===========================================================

Here the page title is continuously changing. but, all
titles contain "Yahoo!"

When ever, you click on any tabs, i.e. (mail, compose,
addresses, etc), the page title changes. but, still
contains "Yahoo!" as part of the string. in this case, we
can use regular expression (while using descriptive
programming):

============================================================
====
Browser("Yahoo! Mail - The best").Page
("ClassName:=Page", "title:=Yahoo.*").WebEdit
("ClassName:=WebEdit", "Name:=login").Set "TestUser"

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is fragmentation and paging?

1672


I have created 3 actions in test action1, action2, action3 but I want run action 1,action 3,action2 how can you change in the actions in keyword view?

714


In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.

1621


• What type of testing questions will be asked for 2+ yrs exp people in interview?

1355


How to save your test using quicktest professional?

638






How to Upgrade or support firefox 2.0 version on QTP 9.0? I have installed QTP 9.0 and installed firefox 2.0. But in REcord and Run Settings, it shows firefox 1.5 in Web tab for browser selection.

1894


What is output value? How many types of output values are there in qtp?

673


What is post recovery scenario?

1748


What is difference between run time object and test object?

643


whow much strong on VB and C?

1581


Want to verify notepad reports using QTP framework or any other BV script method. Can anyone share the method to achieve it? Eg. Person Name is the header and the actual name is John then how can we verify weather person name is John

2245


What is the keyword view and expert view in qtp?

644


How many types of recording facility are available in quicktest professional (qtp)?

697


Explain the concept of object repository and how qtp recognises objects?

617


I want to write some certification courses, so friends could you guide me? which certification is best and how to write exam and what tutorials need to be studied,what to do first, I am working on automation tool QTP 9.2

1594