Highlighted
Frequent Contributor.
Frequent Contributor.
688 views

Implicit Wait for an Object

Hi,

I have my code executing very fast if AUT & Silk are on same network (need not be same all times, environment changes as per requirements), and observed an issue like, step2 execution begins without proper step1 completion. My only thought was to incorporating sleep after each and every line could be the solution. As that we disturb the entire suite, thought of implicit wait for an object. 

So my question is , like we have explicit wait function 'waitForObject', could we achieve this implicitly? That is, I want Silk to wait for every object on every window implicitly. I did follow documentation.microfocus.com/.../index.jsp , however could not find a way to have the silk wait for an object implicitly. Tried with Agent configuration as shown below, no luck or I might be missing some configuration of Agent to handle it. 

If someone is familiar with Selenium, am looking for Implicit Wait concept of Selenium in Silk.  Thanks in advance    

 

 

 

 

 

-Prashanth

0 Likes
4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Implicit Wait for an Object

Hi Prashanth,

The window timeout value that you highlighted in the screenshot above should achieve what you are looking for. The option in question determines the maximum amount of time that Silk Test will wait for a control to exist/appear before returning a "Could not find object" error or executing the action in question.

What error are you receiving when step 2 is executed?

Regards
Robert

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

RE: Implicit Wait for an Object

Hi Robert,

Thank you for the reply.
The window timeout value as suggested in documentation, "specifies the number of seconds Silk Test Classic waits for a window to appear and be in the correct state".
Lets say, to put it to the simplest form, I have a test case of login. Step 1 to enter username, Step 2 to enter password, and Step 3 to click on Login button. Now Silk is so fast that it enters incomplete username & password and clicks on login button. As expected invalid credentials error was thrown. (For this reasons, When u ask about error message, I could tell what definite error message I would get)
Basically I was looking Silk to stop until all the objects being loaded before issues any statement from script.
However increase in Keyboard and Mouse Event did slow down the execution (but this is not something I was looking for though or may be am short of enough information on Silk as am new to it)
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Implicit Wait for an Object

Hi Prashanth,

If you are using the Open Agent, we also have to consider if synchronization is having an effect.

Your screenshot earlier would appear to indicate that you are using Silk Test Classic. On the Classic IDE, please ensure that the Open Agent is selected as the default agent and open the "Agent Options" dialog. You should now find that you have a "Synchronization" tab. What settings are defined here?

If the synchronization timeout is 0, this could cause Silk Test to execute extremely quickly without waiting for your application to get into an idle state.

You may also want to consider using SetText versus TypeKeys if you are observing that some keystrokes are not received by your application. SetText will send the text to the control via an API event rather than using low-level keyboard input and may prove to be more consistent for your application.

-Robert
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Implicit Wait for an Object

Is your application doing any kind of client-side data validation when data is entered? If that is the case, you would like to:

a) use typeKeys instead of setText to force the execution of any JavaScript code expecting key events.

b) introduce a keyboard delay between keystrokes to ensure that your JavaScript can run completely.

In case your application is not doing client-side validation, then you would like to use some other slow down mechanism from the following list: community.microfocus.com/.../how-can-i-slow-down-silktest-execution.

Could you share the problematic lines of your code?

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.