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 frame work you are following?
what is Property......End Property loop? how to write sript for it in QTP
What is fragmentation and paging?
Hi am New to Automation Testing , any one can you help me what are the basic questiion are asked an interview?
Dear Friends, I having total 3+year experience in manual testing including automation testing QTP, if i am attending any interview what kind of question will i get? please help me out
By using QTP can we record any log files written by the application which is in execution?
How will you report the bug and explain the defect tracking sheet you handled?
If you are testing a web application then what will you test in that application?
Is it possible to change the values of analog recording?
How can you pass value one action to another action?
I need to obtain the parent of an object programatically, so if I have: winButton("aButton") I need to obtain the parent part: window("Window1").Dialog("Dialog1") so I can programatically create a string of the full name of the object to call it with an execute statement in QTP I would like to use something like: part[1] = "window(""Window1"")" part[2] = "dialog(""Dialog1"")" so I can do: exeLine = part[1]&"."&part[2]&"."&"winButton(""aButton"")" Execute exeLine Apart from keeping a record of the window/dialog hierarchy is there a parent or path function/ command Thanks Adrian
What are table and db checkpoints?
How did you use regular expressions in QTP and also in WR?
i am trying to automate yatra.com,in that site, when i go to automate the Leaving from field showing as a WEBEDIT, but when i enter 1 or 2 char, it displaying dropdownlist, i try to use keyboard automation to select the item from that list but it is not possible, can anybody help he. Thans for posting the Answer
please any one can explain the keyword driven framework. with gmail example.