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

whare exactly we have to use functions and sub routain

0 Answers  


How you used DDT in QTP?

1 Answers  


I am automating a Java application. This application is developed using SWT. I am not able to get the GUI object. Even i tried with Java add-in. In tutorial it states SWT is not supported any idea. Anybody worked in such appln. My question is whether it is possible to record the GUI object of SWT appln. how it is possible.

1 Answers  


How does QTP identifies the object in the application

6 Answers   Convergys,


what is the difference between IE & Netscape in web testing on a log in page

0 Answers   TCS,






can any one make me confirm about a real time employee with better experience in QTP who is providing QTP course individually in Bangalore???

3 Answers  


what could go wrong with test automation?

0 Answers  


Hi, Can anyone please tell me how to connect the QC with QTP using QTP script? Thanks in advance

0 Answers  


What are the file extensions for per-action, shared object repository files and what is the extension for library files?

9 Answers   Semantic Space,


It is very difficult to test in manual for that we go to DATA DRIVEN TEST.

3 Answers  


Where we can use the analog mode and where we can use the low – level mode?

0 Answers  


I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.

0 Answers  


Categories