Expert view in Quick Test Professional

In the Expert View, each line represents a Test Step in VB Script or in other words we can say that Scripting view of QTP is called an Expert view.

Characteristics of Expert View:

  1. In this view the statements need to be written in VB Scripting. You can now locate specified text strings in the Expert View, and replace them with text strings that you specify.
  2. Expert view displays the test script in command format. This view will be used by the testers, who are familiar with VB Scripting language.
  3. The testers will type the commands in the expert view to add the additional steps.
  4. It is is a script editor with many script editing capabilities.
  5. For each object and method in an Expert View statement, a corresponding row exists in keyword view

How to write script in QTP:

  1. Click on expert view (Use "STEP GENERATOR")
  2. Write steps manually in Expert view in VB scripting language
  3. Record steps in AUT
  4. Run your script

expertview.jpg

Advantages of Expert view:

  1. Writing the procedures and modularization is easier in expert view
  2. Expert view also provides Statement completion, Auto expand VBScript syntax, Content-sensitive help.
  3. If you want to debug the statements like Step Into and Step Out, where the procedure statements also need to be debugged. This is possible, only in expert view.
  4. The VBScript WITH statement allows you to perform a series of operations on the same object. By using the WITH statement, you can group related steps together to make the script easier to read
  5. We can edit the scripts in expert view. editing checkpoint properties. Inserting if conditions, loops, error handling, comments, etc.

In keyword view type mercury in Username textbox and press TAB key in Mercury Tours website.

Corresponding VB script code in expert view in normal recording:

Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours"). WebEdit ("Username"). Set "mercury"
Corresponding VB script code in expert view in low-level recording:
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").Click 564,263
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").Type "mercury"
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").Type micTab

image2.jpg

As in in Low Level Recording mode, QuickTest records the click in the user name box, followed by the keyboard input, including the Tab key.


Similar Articles