NOTICE: Significant community changes coming soon
The header menu and the home page on our community will be changing soon. Get more information HERE.
Highlighted
Absent Member.
Absent Member.
5581 views

Load runner Ajax Tru Client Wait for object not found?

In my application when ever you use some functionality a loading bar appears. In Tru Client I want to end the step whever this loading bar dissappears.

 

i.e. I want to implement  "Wait For object not found"

 

how can i achive this.

 

 

0 Likes
19 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Hi,

We will consider adding such an end event in future version.

Meanwhile you can workaround that either by

> Looping around the object as long as it is visible. When it will disappear the step that looks for it will fail, you should catch the failure with catch statement and break the for loop from within the catch

> or by waiting for the object to become hidden. Sometimes the object does not disappear from the DOM, it is just mark is not visible. In such cases you can wait for that non visible object using Descriptors or XPath of JavaScript identification.

Regards,

Shlomi

0 Likes
Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..

The "not found" functionality actually does exist in TruClient 12.02.  To get this behavior: 

  • add an "IF .. .  EXISTS"  step to the script
  • run your script so the nasty unwanted object appears, then get the object path to it in the "IF . . .  EXISTS" step. 
  • leave the condition blank. This means if the object is found, do nothing. 
  • and add an ELSE condition  to the IF  . . .  EXISTS step.  This means if the object is NOT found, do some action. The action could be to wait, or to repeat a previous action. 
  • Set the object timeout to something like 5 or 7 seconds. This means that if the object is not found within 5 or 7 seconds, the IF will move on to the ELSE part of the statement.

You now have a logic for deciding what to do if an object exists or not.  I have a need for this kind of logic in a application which displays a circular "wait  .. .  processing" twirling icon on slow requests. The UI is blocked during this time and the script will time out unless I wait until the twirling icon disappears. So this functionality is needed but we do already have it. 

 

0 Likes
Highlighted
Frequent Visitor..
Frequent Visitor..

Hi Team,

 

I am also facing the same kind of issue, need to wait untill the spinner go off from Maps. Please let me know if there any solution how to handle with True Cliet web protocol. I need to end the transaction once the spinner disappear.

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Use Wait until object does not exist step. It is available starting 12.56 (maybe also in 12.55)

ObjectDoesNotExist.png

Highlighted
Visitor.

Hi Shlomi,

I am also facing the same problem in TC 12.53, where I am trying capture the spinning element using descriptors (Object property was Class, as I don't have unique id or input text) within a For loop. But it doesn't work.

Our business process is Hit a application URL with unique identifier and wait until the appropriate landing page gets loaded. At times, the landing page gets displayed in advance,but the spinning element appears in the UI.

Is there any workaround to mitigate the problem.
-Vinodh

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Hi Vinodh,

I am sure that with some investment and maybe JavaScript identification you can overcome it. 

Is it possible for you to upgrade to a newer version? The wait for object step is much more flexible and allows waiting until innerHTML of an element is not equal to some value which can also be a regular expression. I am not sure if that will address your case, but it sounds more flexible to me.

Naive question, why do you need to captrue the spinning element at all? Wouldn't it be sufficient to wait until another element apepears on screen after the spinning element is gone?

Regards,

Shlomi

 

0 Likes
Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..

In older versions, this is still possible by combining an "IF  . . .  EXISTS" step with a WAIT step. I have attached a picture. 

 

IFExists.png

 

 

0 Likes
Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..

Adding updated screenshotIFExists.png

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.