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
What is Unicode Compatibility?
Can any one tell me how to write a script for selecting open option in File menu of A word document.here you have to add objects to OR.try like that and give me the ans.i asked this question to so many but no one knows.if any one know the answer plz let me know
Can any suggest me what is exposure testing?
I used child objects to get the no of weblist present in the weblist.now i need to select the items present in each weblist ?How to do so
What is the synchronization point in qtp?
What is the qtp testing process?
how to compare two bitmaps( 1. clients requirement & 2. Designed by dev) in qtp 8.2 wann clear steps
How can we use the "CreateObject("Shell.Application")" in QTP and what is the definition and purpose of it?
I would like to directly import XL file and work on that XL file directly in QTp script in that XL sheet need to allocate workbench,XL sheet and generate two bar graphs automatically how to do that? plz let me know any answers?
How many lines of code in each script of QTP?
To retrive the test data which tool vl use and whats basis u vl write test data? its urgent
how do we know whether all objects are stored in the object repository or not? how can we know if a particular object is not stored in the repository?
I want to test my vb.net solution file using qtp. Does Qtp test only .exe file?
what type of values given to objects. EX::Set oBrowser=Description.Create oBrowser(“micclass”).Value=”Browser”
What are the different recording modes and how do they work?