hi all
QTP recognizing objects
as "string_1","string_2","string_3","string_4" like that
but when using FOR LOOP for these.QTP not proceeding further
can i declare these _1,_2,_3,_4 as a single variable

Answers were Sorted based on User's Feedback



hi all QTP recognizing objects as "string_1","string_2","string_3",..

Answer / sachin

hey,

i have answer to this question.

i too have faced a similar kind of issue when looping
throgh a process while clisk on a link in page..

As stated in the question that values are changing
as "string_1","string_2","string_3","string_4" this is
mainly because the index value is changing..

Note : go to repository for string_1 and check the index
value , likewise check the index value for string_2 and
string_3..check if all three have an oderly increments like
for string_1 the index value in object repository will be 1
and string_2 should be 2.. and so on.

All to need to do is consider one recorded object either
srting_1 or string_2 .. or any one amoung the four recorded
object .. After loop completed one iteration and moves to
second iteration, jst set the index value of selected
object to 1, 2.. and so on ..Use SetTo property method to
set the index value ..

Do let me know if u have any problem's

Thanks
Sachin.

Is This Answer Correct ?    0 Yes 0 No

hi all QTP recognizing objects as "string_1","string_2","string_3",..

Answer / sandipgami84

u can use Refular Expression
string_1,
string_2,
string_3,
string_4,

string_ Is Same... Not Change

string_.* u USE.....

Is This Answer Correct ?    0 Yes 0 No

hi all QTP recognizing objects as "string_1","string_2","string_3",..

Answer / dimple

As per my understanding in for loop qtp is loosing the
object property.
so set the property value again in for loop and try.

Please correct me if iam wrong.

Is This Answer Correct ?    0 Yes 0 No

hi all QTP recognizing objects as "string_1","string_2","string_3",..

Answer / ramchandra patil

u can use Regular expressions and iterate through loop.No
need to declare four variables.


Let me know if u need code.



Ramchandra Patil
9699851282

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

How u call functions in QTP

5 Answers   Lehman Brothers,


What is the pros and cons between QTP and Rational Robot

0 Answers   Virtusa,


How to find the number the number of Links, Brolken Links in a webpage?

3 Answers   Ordain Solutions,


what is main diff of qtp8.2 and qtp9.0?

1 Answers   Covansys,


How can I change object description or check point values in qtp?

0 Answers  






Among all the check points what is the most important checkpoint?

5 Answers   Semantic Space,


In QTP 8.2 there are lot of check points is this same in latest version QTP 9.5 ?

2 Answers  


Does quicktest professional (qtp) is unicode compatible?

0 Answers  


Plz explain about InTERNAl Environment variable, External environment variable,builtin environment variables with examples?

1 Answers   TCS,


what is qtp automation framework, what is the purpose of the framework and which folders included in this framework pls tell me with brief description

2 Answers   PSI Data Systems,


Hi All Below is my script which i made for lgin into Flight.exe. SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open" Dialog("Login").WinEdit("Agent Name:").Set DataTable ("p_Text", dtGlobalSheet) Dialog("Login").WinEdit("Agent Name:").Type micTab Dialog("Login").WinEdit("Password:").SetSecure DataTable ("p_Text1", dtGlobalSheet) Dialog("Login").WinButton("OK").Click If Dialog("Login").Dialog("Flight Reservations").WinButton ("OK").exist Then Dialog("Login").Dialog("Flight Reservations").WinButton ("OK").Click datatable.Value(3)= "Incorrect password. Please try again" Dialog("Login").WinButton("CANCEL").Click elseif Dialog("Login").Dialog("Flight Reservations").WinButton("OK").exist Then Dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click datatable.Value(3)="Please enter agent name" Dialog ("Login").WinButton("CANCEL").Click elseif Dialog("Login").Dialog("Flight Reservations").WinButton("OK").exist then Dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click datatable.Value(3)= "Please enter password" Dialog("Login").WinButton ("CANCEL").Click else Window("Flight Reservation").Move 309,146 datatable.ExportSheet "C:\Raj\Result.xls" ,1 Window("Flight Reservation").Close End If I want to capture the Message string from Dialog("Login").Dialog("Flight Reservations" Also pls let me know if this is the right way to do the script for login. Pls provide some script for login Flight.exe Thanks in advance Raj Dhiman

1 Answers  


What are the recording modes in wave event?

0 Answers  


Categories