Posts: 1
Threads: 1
Joined: Jan 2010
Reputation:
0
01-24-2010, 12:21 PM
Hello,
I have just started to use QTP trial but struggle with following 3 points:
1)How to compare value of some web element (e.g. google - number of found results). Tried to use Val(WebElement) but it throws an error
2) Why I cannot use "Dim A as Integer"? I thought its just VB there.
3)Why debugging is still disabled except from Run to step and why breakpoints does not stop the test?
Thank you very much!
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
01-25-2010, 10:28 AM
Hi Blinza,
Have you gone through QTP User guide /QTP tutorial? I would suggest you to go through QTP tutorial once before jumping to the scripting.
answer for your questions
1)How to compare value of some web element (e.g. google - number of found results). Tried to use Val(WebElement) but it throws an error
- to get the value for webelement or any object you should use 'GetROProperty'
2) Why I cannot use "Dim A as Integer"? I thought its just VB there.
QTP does not supports data types so you cant use 'as Data Type' all variables will be type of variant.
3)Why debugging is still disabled except from Run to step and why breakpoints does not stop the test?
more explanation required on what do you mean by 'still disabled', QTP tests stops at breakpoints, how did you used that?
Posts: 1
Threads: 0
Joined: Jan 2010
Reputation:
0
01-25-2010, 12:04 PM
Hi,
Regarding the debuging, I have the same problem. I place breakpoints to the code but the QTP ignores them. In the Debug menu, there are always all items disabled except for Run to step. Maybe due to trial version?
Posts: 45
Threads: 13
Joined: Dec 2009
Reputation:
0
01-25-2010, 04:38 PM
"Microsoft Script debugger" is not installed in your PC while you installed QTP. It is required. You just install script debugger then all tour options will get displayed and you can debug your script.
Posts: 4
Threads: 0
Joined: Jul 2010
Reputation:
0
07-09-2010, 11:23 AM
(This post was last modified: 07-09-2010, 11:31 AM by Kasanagottu.)
3) if "Microsoft Script debugger" is not installed in your PC debugging options will be in disabled mode.if u want enable that must while installing the Microsoft Script debugger.
2) Why I cannot use "Dim A as Integer"? I thought its just VB there
Ans :VBScript supports only one data type called ‘Variant’. The variant data type is a special kind of data type that can contain different kinds of information. It is the default data type returned by all functions in VBScript. A variant behaves as a number when it is used in a numeric context and as a string when used in a string context. It is possible to make numbers behave as strings by enclosing them within quotes.