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
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 |
What are the different recording modes?
In a WebTable 2nd row,3rd column contains one link and that link name is changing dynamically. How you will click the link?
What is the difference between Client/Server application and Web application ?
What is business process testing(bpt) in qtp?
Why do we go for Qtp? What are the advantages of qtp? Diff between winrunner and Qtp?
I wnnt to learn about QTP Automation Framework,please give URL Address to get more information about AFW.
how to test background color and dynamic images during runtime
we have 10 automation scripts. how to call them from one main script.
What are the parameters provided by QTP?
Write code for ,We have a web table with rows and columns like EmpID EName Action 1 ABC Edit Delete 2 XYZ Edit Delete 3 PQR Edit Delete In the above Table the last column has two links we have to click first link based up on EmpID =2
How to get line numbers in your editor in expert view?
How to add multiple values in rows, under a single column of a run time datatable?