Web Click and Script Tips and Tricks

Web Click and Script Tips and Tricks

General Overview of Web Click and Script Protocol

The Web Click and Script protocol is introduced in VuGen 8.1 FP2. The major advantage of the Web Click and Script protocol is that it supports client side JavaScript during replay. As a result, the need for correlation is drastically reduced and hence scripting time is reduced as well. It introduces a GUI-level scripting API, and an extremely quick way to generate load testing scripts.

* With Web (Click and Script) you will save valuable scripting time. The easy-to-use script eliminates the need for correlation.
* New intuitive API functions describe user actions on Web objects (button, text link etc.).
* In tree view, the steps are grouped according to their pages.
* In snapshot viewer, the object corresponding to the active step is highlighted.
* Can create a Business Process Report (Microsoft Word format) summarizing the VuGen script.
* The LoadRunner QuickStart contains an appendix illustrating the new Web (Click and Script) features. Access the QuickStart from the Windows Start menu Mercury LoadRunner > QuickStart.

VuGen Version and Requirement

VuGen 8.1 FP2 and above

Supported browser: Only Internet Explorer 6

Supported Operating Systems: WinXP/2000/NT (not Win2003)

Recording Options

GUI Properties tab is related with the new features available in Web Click and Script.

Breakdown of Recording options available under GUI Properties -> Advanced

Enable out of context recording: VuGen does not natively support the recording of ActiveX controls and Java applets. You can instruct VuGen to create a URL-based script for ActiveX controls and Java applets, so that they will be replayed. Since these functions are not part of the native recording, they are referred to as out-of-context recording (enabled by default).

Record rendering: Record the values of the rendering-related properties of DOM objects (e.g. offsetTop), so that they can be used during replay. Note that this may significantly decrease the replay speed. (disabled by default).

Record `click’ by mouse events: Record mouse clicks by capturing mouse events instead of capturing the click() method. Enable when the recorded application uses the DOM click() method, which may result in generating multiple script functions for the same user action. (enabled by default)

Web Event Configuration: Changing the settings under this recording option will affect how sensitive VuGen is to capturing events when navigating a webpage. When moving the mouse over an image on a webpage, the web event configuration decides whether to record this as an event or to record an event only when a mouse click occurs.

Choosing the “High” Web Event configuration option slows down the recording and could also result in some events being captured twice. This setting should be used when events that are expected are not captured.

Choosing the “Basic” Web Event configuration option is the fastest. This setting should be used unless certain expected events are not captured.

For more detailed information on custom web event configuration, please click on the Help button on the Web Event Configuration box.

Best Practices

• Use the mouse and not the keyboard as far as possible.

• To capture events, work only on browser windows opened by VuGen

• Wait until the page loads completely before going on to the next step of the business process.

• Always start recording on a new script. Do not record over an existing script.

• Avoid using context menus i.e. menus which pop up when clicking an item in a GUI.

• DO NOT reorder functions or move them from one section of the script to another.

Limitations

• Records and emulates on Internet Explorer version 6 only

• Does not support recoding on Windows 2003

• Does not support VBScript and Applets

• Does not support user actions on ActiveX objects and Macromedia Flash

• Supports only English language applications

• Scalability is lower than the Web HTML protocol

• Replay snapshots may differ slightly from the actual Web page

• Modal Dialogs are not supported

• The automatic generation of web_reg_find statements for page titles does not work in Web Click and Script. Workaround is to manually add the web_reg_find after the script has been recorded.

Tips and Tricks

• When the HTML contains code such as Offsettop or Offsetleft (which are properties used to give the coordinates of the element) : Enable record rendering related property values under Recording Options -> GUI Properties -> Advanced.

• To record “mouse over”, “mouse down” events on a webpage : Change the Web Event Configuration to High under Recording Options -> GUI Properties -> Web Event Configuration.

• If the script continually fails on a particular step: Try replacing that step with Alternative Navigation . Right click on that step and choose “Replace with alternative navigation” on the menu that comes up.

• If a “Button Not Found” error is seen: Check to see if the value in the script is the same as that reported in the replay log. If not, replace the value in the script by that reported in the replay log.

Example:

The following is recorded in the script:

web_button(“BUTTON”,

“Snapshot=t2.inf”,

DESCRIPTION,

“Type=submit”,

“Tag=BUTTON”,

“ID=”,

“Value=<B id=a>Google Search</B>”,LAST);

Hint: The replay log contains:

Name=”btnG”, Id=””, Value=”<B id=”a”>Google Search</B>”, Text=”Google Search” [MsgId: MMSG-26000]

Change the script step as follows:

web_button(“BUTTON”,

“Snapshot=t2.inf”,

DESCRIPTION,

“Type=submit”,

“Tag=BUTTON”,

“ID=”,

“Value=<B id=\”a\”>Google Search</B>”,LAST);

• If the HTML element ID changes dynamically: Use the ordinal attribute instead of the ID attribute.

Example:

web_image_link(“IMG_52549_2”,

“Snapshot=t2.inf”,

DESCRIPTION,

“Alt=”,

“ID=IMG_52549”,

ACTION,

“ClickCoordinates=33,28”,

LAST);

In the above example, the ID=IMG_52549 changes each time.

Solution:

web_image_link(“IMG_52549_2”,

“Snapshot=t2.inf”,

DESCRIPTION,

“Alt=”,

//”ID=IMG_52549″, Commented out as it is dynamic

“Ordinal = 12” //This is the ordinal of the image on the page.

ACTION,

“ClickCoordinates=33,28”,

LAST);

Advertisements

7 thoughts on “Web Click and Script Tips and Tricks

  1. anu

    Hi I am facing the same error as “Button not found” and I am not able to find a solution to replace the “Value=Google Search”,LAST);

    as you told, as because this step is not there in the replay log…please need help….it’s just a very simple script and am really stuck with this for days now!

    Reply
    1. Prannoy Chowdhary

      @ Anu , replace the “Google Search ” with the value that comes in the replay Log , meaning “btnG” and, if you are looking to replay the script with the button “I’m Feeling Lucky” pressed , then replace it with “btnI” . 🙂

      Reply
  2. Sain

    Hi am using Web(Click and Script) and during reply am getting below error message.I am new to this protocol.Please suggest how to proceed further.
    Error Message in replay:
    Action.c(115): Error -26190: Web element not found (Tag is “”, Text is “Edit”) [MsgId: MERR-26190]
    Action.c(115): web_element(“Edit”) highest severity level was “ERROR” [MsgId: MMSG-26391]

    Below is function from Vugen:
    lr_start_transaction(“ClkPreviousEmpEdit”);

    web_element(“Edit”,
    “Snapshot=t8.inf”,
    DESCRIPTION,
    “Text=Edit”,
    “Tag=A”,
    “Ordinal=1”,
    “BrowserOrdinal=2”,
    ACTION,
    “UserAction=Click”,
    LAST);

    lr_end_transaction(“ClkPreviousEmpEdit”,LR_AUTO);

    Reply
  3. Bhargava

    Hi I am working on Oracel 11i (GUI Protocal) I am getting an error while replaying the recorded script.
    Action.c(82): Error -26227: Image not found [MsgId: MERR-26227]

    for the below transaction

    web_image_link(“expand”,
    “Snapshot=t7.inf”,
    DESCRIPTION,
    “Alt=expand”,
    “ID=”,
    “Name=”,
    “Ordinal=4”,
    ACTION,
    “ClickCoordinates=11,10”,
    LAST);

    web_image_link(“expand_2”,
    “Snapshot=t8.inf”,
    DESCRIPTION,
    “Alt=expand”,
    “ID=”,
    “Name=”,
    “Ordinal=4”,
    ACTION,
    “ClickCoordinates=6,12”,
    LAST);

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s