Showing posts with label ajax true client protocol. Show all posts
Showing posts with label ajax true client protocol. Show all posts

Tuesday, 5 May 2015

How to Set Proxy Values for all the Ajax TruClient Scripts?

LoadRunner launches Firefox in a temporary profile every time a script is opened for development.

To make the proxy settings available across all these profiles please use the global profile settings do this:

• Open VuGen.
• Open an Ajax TruClient script.
• Go to Tools > Ajax TruClient Browser Options…
• In the dialog that opens (“Ajax TruClient Browser Configuration”), select the Proxy tab and
define the appropriate Proxy settings.
• In the script, open the Run-Time Settings dialog and then select the General > Other Settings
node.
• In the Proxy selection node select the “Use global proxy settings” option. This will make sure
that every time the script is opened for development the proxy settings are refreshed from
the Ajax TruClient Browser Options.

The Run-Time Settings also enable defining specific proxy settings for each script.

How Can I Use JavaScript to Locate Objects in Ajax True client script?

Using the JavaScript identification method you can write JavaScript code that references the returned
document and can use CSS selectors and other standard functions.

For example, the page returned by the server contains multiple links with the same “title” attribute
(search results) and we want the script to randomly click on one of the available links.
Object identification for this case, using the JavaScript identification method, may look something like this:

var my_results = document.querySelectorAll('a[title="SearchResult"]');
my_results[Math.floor(Math.random() * my_results.length)];

Wednesday, 25 February 2015

What is AJAX TrueClient Protocol in Loadrunner

AJAX (Asynchronous JavaScript and XML) is a technique for creating
interactive Web applications. With AJAX, Web pages exchange small packets
of data with the server, instead of reloading an entire page. This reduces the
amount of time that a user needs to wait when requesting data. It also
increases the interactive capabilities and enhances the usability.

AJAX components, also known as AJAX controls, are GUI based controls
that use the AJAX technique - they send a request to the server when a
trigger occurs.

The Ajax TrueClient protocol interactively records scripts on the user level.
This enables VuGen to record dynamic, complex web-based applications
and create user friendly scripts. Scripts are created in real-time and steps can
be seen in the LoadRunner VuGen for TrueClient tab of Mozilla Firefox as
they are performed.

AJAX Supported Frameworks:
The supported frameworks for AJAX functions are:
1) Atlas 1.0.10920.0/ASP.NET AJAX—All controls
2) Scriptaculous 1.8—Autocomplete, Reorder List, and Slider
VuGen supports the following frameworks at the engine level. This implies
that VuGen will create standard Web Click and Script steps, but not AJAX
specific functions:
3) Prototype 1.6
4) Google Web Toolkit (GWT) 1.4

Steps for recording Ajax script:
1) Configure the Run-Time Settings
Configure the Run-Time settings before recording and performing a load
test. To open the Run-Time settings dialog box, click F4.

2) Configure the Global Browser Configuration Settings
The Firefox Browser Configuration settings allow you to configure
settings that apply to all TrueClient scripts. The settings are imported to
new scripts as they are created. To open the Browser Configuration
settings dialog box, click the Edit Browser Options button from the
Record toolbar in the VuGen main window.

3) Start developing the script
Click Develop Script to initialize the interactive recording session in
Mozilla Firefox.

4) Record interactively
Navigate to the desired starting website and click record. All of your
actions will be recorded and displayed in the VuGen tab on the left as you
perform your business process. You can pause or stop the script and
continue recording from any point in the script.
To record into different sections of the script, use the drop down bar
above the toolbars.

5) Enhance the script
You can enhance your script in a number of ways such as inserting
parameters, transaction, loops, and verification steps.

6) Replay the script in Firefox
Replay the script at least two times, correcting any errors that occur
during the process. After two successful consecutive replays, you can
move on to the next step.

7) Stop developing
Click the Save button to save the script. Close the firefox window.

8) Replay the script in Load Mode

TrueClient scripts are run slightly differently when performing load
testing, so Load Mode was created to run the script exactly as it will run
during load testing. In the VuGen main window, click the arrow next to
the Develop Script button to replay the script in Load Mode. Progress can
be monitored in the Interactive Replay log. Firefox does not open, and
snapshot are not displayed.

Tuesday, 10 February 2015

How to Resolve Object Identification Issues in Ajax Trueclient Script

In dynamic websites, objects which have been recorded can often move or
change content. This can cause the script to lose the ability to locate the
object. The following steps describe the ways to resolve these issues. When
identifying objects for applications that recorded in windows, make sure
that the correct window is selected using the Window tab.
 - "Highlighting an object"
 - "Improve Object Identification"
 - "Modify the Object Identification Method"
 - "Modify the script timing"
 - "Relating objects to other objects"
 - "Replacing an object"

1) Highlighting an object
Regardless of which method of object identification is used, you can use the
highlight button to check if an object is visible in the application at any
time. If the object cannot be found, an error message is displayed.

2) Improve Object Identification
Use this option first if the object was not found or if multiple objects were
found. Objects are identified using the objects properties. Some of these
properties may be dynamic and thus prevent object identification during
replay. The Improve Object Identification button next to the ID Method
field identifies the object a second time and uses the two definitions to
create a more accurate object definition.

3) Modify the Object Identification Method
You can modify the way TruClient identifies the object by modifying the
object identification method in the Object section of the step properties.
defined The following options are available:

a)Automatic. TruClient’s default object identification method. If this
method does not successfully find the object during replay, click the Improve Object Identification button and replay the script again.
b)XPath. Identifies the object based on an xpath expression that defines
the object in the DOM tree. You can manually modify the expression.
To regenerate the original expression generated by VuGen, click the
Regenerate Expression button.
c)JavaScript. JavaScript code that returns an object. For example:
document.getElementById("SearchButton") returns an element that
has a DOM ID attribute of "SearchButton".

4) Modify the script timing
Sometimes objects may not be found because of timing and
synchronization issues. For example, the script may be looking for an object
that was in the application, but the script replayed too quickly and already
progressed to another page. If you suspect that the object is not being found
because of a timing or synchronization issue, you can insert Wait steps.

5) Relating objects to other objects
If an object becomes difficult to identify on its own, you can label the object
based on a different, more stable object. For example, you can select an
object which is not dynamic and "relate it" to the target object. Relations are
defined visually, relating objects according to their distance in pixels from
other objects. Relations are defined per ID method, per object. If more than
one relation is defined for an ID method of a given object, both relations
must locate the same object for the step to pass. VuGen then uses this object
to help locate the target object. To use this function, expand the step, select
Object > Related Objects, and click the add button. Follow the directions to
create a relation. Verify that it has worked by highlighting both the object
and its related object.

6) Replacing an object
If you selected the wrong object during recording, or an object has
permanently changed you can replace it with a different object without
replacing the step. This effectively resets the step, deleting changes made to
the original step such as relations. Expand the step, select Object, and click
the Replace button. Select the new object and replay the script.

Wednesday, 24 September 2014

How to Set Proxy Values for all the Ajax TruClient Scripts

LoadRunner launches Firefox in a temporary profile every time a script is opened for development.
To make the proxy settings available across all these profiles please use the global profile settings.
.
To do this:

• Open VuGen.
• Open an Ajax TruClient script.
• Go to Tools > Ajax TruClient Browser Options…
• In the dialog that opens (“Ajax TruClient Browser Configuration”), select the Proxy tab and
define the appropriate Proxy settings.
• In the script, open the Run-Time Settings dialog and then select the General > Other Settings
node.
• In the Proxy selection node select the “Use global proxy settings” option. This will make sure
that every time the script is opened for development the proxy settings are refreshed from
the Ajax TruClient Browser Options.

The Run-Time Settings also enable defining specific proxy settings for each script.