Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3 basic questions..please help
#1
Solved: 10 Years, 9 Months ago
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!
Reply
#2
Solved: 10 Years, 9 Months ago
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?

Reply
#3
Solved: 10 Years, 9 Months ago
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?
Reply
#4
Solved: 10 Years, 9 Months ago
"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.
Reply
#5
Solved: 10 Years, 9 Months ago
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.
Reply
#6
Solved: 10 Years, 9 Months ago
2)Why I cannot use "Dim A as Integer"? I thought its just VB there

As others mentioned above VBScript supports only one data type called ‘Variant’. You just need to declare the variable without any data type, the value assigned to it determine its data type. Its usage determines its data type.
Ex:
Code:
Dim A, B
A = 23
msgbox A
A =  "as"
B = A
msgbox A
A =45

C= A
msgbox "B = "& B
msgbox "C="&Cstr(C)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  few questions?? ACCBAJPA 1 2,295 07-08-2014, 02:01 PM
Last Post: QTpier
  QTP supportabi​lity questions debby_huijin 1 2,096 05-19-2014, 06:32 AM
Last Post: debby_huijin
  Hello All -Nice forum to start learning QTP. Few questions QTP.learning 0 1,790 05-18-2014, 04:10 PM
Last Post: QTP.learning
  Estimate for preparing a basic test script QTPBeginner48 4 2,791 02-25-2014, 03:45 PM
Last Post: guin.anirban
  Basic error handling RandomGrin 3 3,728 10-12-2013, 07:50 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)