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 test fly out menu in qtp?

0 Answers  


Which functionalities of QTP used in banking project?

0 Answers  


I heard that in Hyderabad Ameerpet is renowned for its training institutes it has , but from my own experience I can only say that this institutes have become money making machines losing their cognitive ability and ethics , can anybody tell me is there a good ins. in hyderabad for testing tools.?

2 Answers  


What is the difference between QTP 8.2 object repository and QTP 9.2 object repository Any body have an please give Answer Mail id: nagireddy.sn@gmail.com

5 Answers   IBM,


what is meant by iterative model?What is its working principle?What are its advantages and what are its drawbacks?

2 Answers  


what is parameterisation?

3 Answers  


write a script for get the following result: username password frm the string1="A=username" string2="B=password"

3 Answers   Oracle,


suppose i login into gmail page after that i read all the messages (say 10 messages) i have to send (SAVE) the messages in Html,notepad and i have to replay(Compose) send the messages please give me the code and give mail id so that i can clear my question

0 Answers  


How to create Reusable and Multiple Actions?

0 Answers  


keyword driven framework having how many folders? explain folders in detail?

1 Answers  


write script for "dropdown button having how many words? for ex.SELECT CITY is dropdown name.. find out how many cities in that?

1 Answers  


what is framework? which frame work u follow for writting script?

5 Answers   IBM,


Categories