what is regular expression how will you implement it?



what is regular expression how will you implement it?..

Answer / 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

More QTP Interview Questions

hai friends i already ask this question but when i post the question the alignment goes wrong .....my question is we have a WEB TABLE ....assume that web table having 3 row's and 3 column here in 2nd row 3rd column having VISIT FACEBOOK link...now i want to check the VISIT FACEBOOK link is available or not ..if it's there i want to click the link ...then how to find the web table row or column count ....don't write the excel or data table script here friends .....consider that it's a WEB TABLE do a favour ...thank's

3 Answers  


When I parameterize a script then for each iteration script is executed from begining to end. If I want to execute some middle steps multiple times using Parameterization (avoiding begining and end steps), what is the solution of this (e.g. total steps are 1 2 3 4 5 and i want 2 3 4 only(not 1 nd 5)

3 Answers  


Explain me in deatail about DATADRIVEN framework including scripts ?(realtimes plz)(Chandana)

4 Answers   Wipro,


How to enable the text check point in qtp? By default it is disables

1 Answers   Sify, ssinformatics,


Is virtual object supported in low level recording mode?

0 Answers  






How can you connect the database with QTP?

3 Answers  


I m new to QTP? Is it necessary to know VB for learning QTP for Automation? Can I understand QTP excellently Without practical automation?

3 Answers  


How to supress warnings from the "Test results page"?

3 Answers   Crea,


How do we count the no of mails in Yahoo Inbox for a specified week?

0 Answers  


Q) Please any body can help me how we can create descriptive programming if the application is not ready i.e we don't have unique property of object ? note:build not ready means we can't use object spy in build to get unique property .

2 Answers  


Is there anyway to have QTP go into a website and map out every object before I actually record any tests? I basically want to map out a website with all the objects and build a complete repository. The reason is because I'm running into issues with hierarcical objects. for example: Browser("ABC company- Home").Page("ABC company - Home").Link ("About Us").Click Browser("ABC company - Page 2").Page("ABC company - Page 2").Link("About Us").Click Both these links ("objects" and I use that term loosely as I'm trained mostly in OO programming) go to the same place but but the object heirarchies (pages) are different. I want a repository that will find any possible link on any possible page without having to manually record it. Is there a way to do this?

1 Answers  


suppose i can done the project in automation tool with QTP in that time what i can say?

3 Answers  


Categories