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

How qtp identifies objects?

783


Can we Test Welcome Screens and Process Images with QTP

1708


How can you pass value one action to another action?

813


How to check bitmap output value?

892


can any boby tell me what is method or steps to connect the remote desk top by using QTP 9.2 version?

1835


Can launch two instances of qtp on the same machine?

798


Explain the concept of object repository and how QTP recognizes objects?

780


What is a Patch in QTP?

821


How to check feasibility of the appliction?in automation testing?

1749


write the vb script for call to new action in qtp?

2051


How to customize qtp?

824


What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?

968


How do you capture tooltip using QTP?

861


How to run an integrated test scenario using Multiple Actions? How to use the QTP Step Generator?

3741


what the difference between shared repository and per action repository?

792