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



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

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

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




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

there are having 10 checkboxes..how can i check only first 5 check boxes by using descriptive programing..

10 Answers   HealthAsyst,


Hi .. i want to write the script for the combo nox list . For example if any combo box having a multipul itme. So how can i retrive each item for each iteration ? help me out .

2 Answers  


can we install qtp in windows vista

2 Answers  


what is the criteria for choosing test cases for automation? Ex: if you have some 300 test cases, then how many you choose for automation. what is criteria of selecting?

3 Answers   TCS, Delhi University, Aricent,


Can Any One Write How to Write the Script for Child Objects

4 Answers  






we add library file used in test via settings or through "ExecuteFile" command. when we implement framework do we make common library file and load the same for all the test cases execution?

0 Answers  


How will u integrate oracel with QTP?

2 Answers   Microsoft,


The string is like POWER STAR PAVAN , write a script for this how to findout the number of "A" in the string ?

7 Answers   TCS,


1) 100 test boxes there in application. how to click 100 test boxes using vb script? 2) 100 objects there in web page,how we will store that 100 objects repostries?

3 Answers   ANZ,


Tell when we call the function? tell with example.

1 Answers  


How to capture dynamic objects in qtp like mark up text

3 Answers  


Hi... Can anybody help me to write the vbscript for this question..!!! Am having a string "HELLO WORLD", i want to find how many "L"s are there.....????? --> HANEEF <--

5 Answers  






Categories