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 to create flat file datasubmission in qtp

1905


What is checkpoint in qtp?

552


Why do we use "Text checkpoint" If we can make use of it in "standard checkpoint" ?

1486


Can we access the java methods in qtp. Because my requirement is to access the swt(for eclipse an it is java code) methods in qtp is it possible?

1526


I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format. Hence, if possible, kinldy mail PDF file to my mail-ID: sushmapokhriyal79@gmail.com

1499






What is a checkpoint? How many check points are there in qtp?

530


How to do the scripting. Are there any inbuilt functions in QTP? What is the difference between them? How to handle script issues?

576


Is it possible to merge two object repository files in qtp?

622


What is clean sweep?

1380


what are the utilities and drivers

1847


What is action split and the purpose of using this in qtp?

537


What are the steps involved in recovery scenario wizard?

529


What are the differences between quicktest professional and winrunner?

538


what is review

1613


can i change the runtime properties of an object ? How can i check if a parameter exists in database ?

1415