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

While writing script using For Next Statement in QTP, I try defining the variable in Lib File I am getting syntax error whereas if I use the variable in script file, the script works fine. Can anyone help me in finding the reason behind this?. E:g Dim intStartRow (Define in Lib File----- say abc.vbs) Dim intRow (If I define this variable in Lib file I am getting Syntax error where as if I define in the script file ---- say xyz.mts the script works fine) IntStartRow=2 For intRow = intStartRow to xlWrksht.UsedRange.Rows.Count ‘Some Code here Next

1 Answers  


which command u will use to access the application through descriptive programing?

7 Answers   Datamatics,


What type of automation frame work you are using?and why?

2 Answers   Wipro,


how to pripare BRS/FRS Document for different projects?

1 Answers   Wipro,


wt is the xtension of the QTP result view file?

4 Answers  






Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?

1 Answers   Crea,


Hi, Hope you viewers are doing fine with good health. What are the steps and connection parameters to connect to Oracle db ? Can you connect with just the Oracle client or Oracle XE ? Cheers!!

0 Answers   Infosys,


WHAT IS THE DIFF BTW KEYWORD DRIVEN TESTING AND DATA DRIVEN TESTING?

1 Answers  


What is the difference between low level recording and virtual object.

2 Answers   Tech Mahindra,


How to pass a variable in Dos Command using QTP? Eg: Dim path1, path2 path1 = "C:\Test\sample1.doc" path2 = "C:\Test\sample2.doc" How can we pass these path1 and path2 inside the "copy" dos command? I tried like this. this is not working. oShell.run "cmd /K copy" &path1 &path2

1 Answers  


When you open QTP, how many sheets you can see?

0 Answers   Wells Fargo,


what is bultin funtaion in QTP &tell me five examples?

5 Answers   Kanbay,


Categories