when I try to run below script in QTP "totalPages" value is
2. But i am getting error message (Type mismatch:
'totalPages' Line (): "For i=1 to totalPages".)


totalPages=Browser("Name:=User").Page("Title:=User").WebElem
ent("innertext:=of.*").GetROProperty("InnerText")
msgbox totalPages
For i=1 to totalPages
rnum=Browser("Name:=User").Page("Title:=User").WebTa
ble("column names:=User Name;ID;Last Name;First
Name").GetRowWithCellText("store4")
If rnum>0 Then
r=rnum
Exit for
End If
Browser("Name:=User").Page("Title:=User").WebElement
("html tag:=A","x:=471").Click
MsgBox "Exit"
Next



when I try to run below script in QTP "totalPages" value is 2. But i am getting error me..

Answer / ashok

Hi,
totalPages value is in string, that so u got this error
change to numeric, for that use CInt

example:
totalPages = CInt(Browser("Name:=User").
Page("Title:=User").
WebElement("innertext:=of.*").GetROProperty("InnerText"))

Or

For i=1 to CInt(totalPages)

Regards,
Ashok

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More QTP Interview Questions

How to get the format of a webedit class in qtp. How can i know that particular webedit accept what type of format like "mm/dd/yyyy" or "$" or Alphanumeric

0 Answers  


What are the common defects found in your project? (in qtp interview)

0 Answers   TCS,


HOW TO CONVERT MANUAL TEST CASES IN TO AUTOMATION TEST SCRIPTS EXPLAIN THE PROCESS?

0 Answers   ADP,


how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)

0 Answers  


explain keyword driven framework with banking domain?

0 Answers   TCS,






In website, protocol has been changed http:to https what you will do? tell me your approach?

1 Answers  


Explain more about the Test Fusion Report of QTP?

0 Answers  


Hello Everybody, Please tell me can we create Test Plan in QTP? This I am asking irrespective to integrating with Test Director.I mean is there any option to create Test Plan in QTP itself. Thanks, Gaytri

4 Answers  


what is the use of descriptive programming in QTP ? when we need to use DP? can we test the application completely with out useing DP?? please explan with example

2 Answers  


Call to copy of an action and call to existing action… i know the diff but in real project how to use..? i want live scenario.pls help me..

0 Answers  


how to get the data from a winedit box in vb scripting and store it in a variable if data contains "_"(i.e data is TEST_1)

3 Answers  


What are the disadvantages of Recovery Scenarios in QTP ?

3 Answers  


Categories