While writing script using For Next Statement in QTP, I try
defining the variable in Lib File I am getting syntax error
whereas if I use the variable in script file, the script
works fine. Can anyone help me in finding the reason behind
this?.
E:g

Dim intStartRow (Define in Lib File----- say abc.vbs)

Dim intRow (If I define this variable in Lib file I am
getting Syntax error where as if I define in the script
file ---- say xyz.mts the script works fine)

IntStartRow=2

For intRow = intStartRow to xlWrksht.UsedRange.Rows.Count

‘Some Code here

Next



While writing script using For Next Statement in QTP, I try defining the variable in Lib File I am..

Answer / jay prakash

should be some simple error in ur declaration. Nothing big
in this.

Do as below:

In Lib file, MyLib.vbs:
Dim i
i=10

In Script File
msgbox i

Include the lib file and run the script. No error.

If you can share the script i may be able to help u in
identification of your error.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

How to Get the Run-time value of an object under that web app under Test to the local data table sheet of that Action?

2 Answers  


hi friends can any one provide me the project in qtp because i have to attend to interview within one week atleast you provide the website address which provide the qtp projects

2 Answers  


How to retrieve value (data) from notepad using QTP ?

5 Answers   Health Care,


What are the Features & Benefits of Quick Test Pro (QTP 8.0)?

1 Answers  


What is Object Spy?

7 Answers   JKH, Ordain Solutions,






in QTP we test web based application at that time what script is run? is support vb script? plz tell me

3 Answers  


When I click on a link in web page.Link should open in new window.can anyone please let me know the script for this ---Koti

0 Answers   HCL,


Idid my qtp course in 2007 june in mind Q i for got to use this tool ,i want to mention in my resume about this ,how can i rectify this ,pls give me any idea .

2 Answers   Quest,


Can we create test script with out Step Generator?

4 Answers  


A web page title might be xxxx@xyz.com or xxxy@xxx.co or xyz@abc.in.Using what mandatory properties can be the page identified.Give the regular expression for that.

3 Answers   Virtusa,


How to create frame work for qtp?

1 Answers   Bank Of America, Polaris,


WHAT IS THE USE OF "FUNCTION GENERATOR" IN QTP?

9 Answers   CTS,


Categories