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
Answer Posted / 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 View All Answers
Explain different recording modes?
What is the latest version of qtp?
To retrive the test data which tool vl use and whats basis u vl write test data? its urgent
How to use Environment parameterization? Explain with an example.
Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji
What is standalone database?
What is the syntax to call one script from another?
In an interview, what r the general questions asked in SQL which is realted to testing ?pls give me anwser to this question?
How to record a qtp script ?
Why script error occur in between recording in qtp?
What is difference between shared and local object repository?
what is vmodel?advantages and disadvantages of vmodel?
How to test the login page in different ways in automation testing and i need code?
Why bpt?
how we connect 1. qtp9.2 to the quality center9.0? 2. Load runner8.0 to the quality center9.0