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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Can any body please tell me the steps of keyword driven framework of QTP.

1561


Can UFT be connected to Quality Center? If ‘Yes’ brief the process or steps.

624


How do we handle run-time errors?

571


What is a quick test professional?

618


How to Test the mainframe application?

1816






what r the verstions from 1st to present (verstions) of mercury tools (like winrunner,QTP,Loadrunner) ? Chandana

1458


Can we use index on view?

1595


How QA specialist can identify when programmatic descriptions are useful?

1964


What is the difference between the design-time and run-time data tables?

552


How to create scenario selector

1470


What are the benefits of qtp?

548


How software automation specialist enter steps in the Expert View?

1670


Where you get the run time data table?

575


In order to select an automation tool for automating ur application, what r the things u need to consider? For eg i will go for automation; 1) When there is a lot of retesting and regression testing. 2) Return on investments. 3) Whether the tool supports the appln. 4)--------------, etc. Pls give me more number of points because my answer did not satisfy the interviewer. Very urgent pls

1441


Explain the differences between table and db checkpoints?

569