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


Please Help Members By Posting Answers For Below Questions

How will you test a keyboard?

830


How to use the object spy in quicktest professional (qtp) 8.0 version?

741


Difference between test object and run time object?

782


Hi, I am using OutputCheckPoint for 2 webelements Bed:4 and Bath:2 Full,1 partial in my result page and I am storing the value in the data table. I dont need the string Bed:4,I would like to get only the no 4. How can I get it? Even though I highlight only 4,It is seleting the full value "bed 4". Same thing happend for second webelement Bath:2 Full,1 partial I need only the No 2. I used the following to split MyArray = Split(UIBathResult, " ", -1, 1) But it is giving the value My Array(0)=Bath:2full,1Partial I need the only the nos for further comparision.Any help? Thanks Uma

3645


Mention what are the different types of recording modes in qtp? Which will be used when?

794


This is Karthic and my mail id is karthic.venkitapathi@gmail.com, please give me an idea to crack qtp 10

1737


If we put all properties in mandatory and assistive list of Normal Identification, Do we still need Smart?

783


Which scripting language used by quicktest professional (qtp)?

909


Explain qtp(quick test professional)?

786


How can get count of list box?

870


What is RTM (require ment tracebulity marix) fromate?

1733


Whar are the challenges do we face while testing web based applications using the automation tool QTP or any??

1866


If a button named "CLICK" is recorded in low level recording mode , what will be the values stored for "name" property of that button in object repository ?

1974


How many types of recording modes in qtp? Describe each type with an example where we use them?

821


when I was doing the web testing with QTP using with standard checkpoint the Object selection -checkpoint properties dialog box not displaying pages and links hierarchical order. Could you please tell me. thanks

1990