SilkTest Workbench - How do I use the Exists method in a Visual test?

SilkTest Workbench - How do I use the Exists method in a Visual test?

Problem:-

How do I use the Exists method in a Visual test within SilkTest Workbench? My test always fails even though the object I wish to verify exists on the application? 

 

 

Resolution:-

When you record the Visual Test test step for the Exists method, the locator attributes for both Object and Action catagories are not completed.

You will be required to manually complete these fields.

The below example demonstrates how to complete the requires fields against the Insurance Co website, available at http://demo.borland.com/InsuranceWebExtJS/index.jsf

 

1) When the "Exists" method is inserted against against a control such as the above item, the full locator is entered into the Object's locator property within the test steps properties.  As shown in the image below:

2) As you can see from the image above, there are two properties named Locator, one under the Object heading, the other under the Action heading.

3) We will first modify the Locator under the Object heading, this is considered the parent locator.  From the full locator we can see that the login buttons parent is the browser window.

We can thus cut "//INPUT[@id='login-form:login']" from the locator value.

The remaining value will represent the parent locator i.e "/BrowserApplication//BrowserWindow"

4) Next we place the cursor inside the textfield for the Locator property under the Action heading, this is considered the child locator.

Perform a right a right click and select paste from the menu

The value should now read "//INPUT[@id='login-form:login']"

The properties should now look similar to the image below:-

 

5) When you run the script the expected "True or False" value will now be returned from the "Exists" method to the reserved variable "st_LastReturnValue".

 

 

 

 

 

 

 

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Comments

Hi.

I'm trying to use this method in a ".net" test but I can't.

can you help me please?.

I'm using silkTest Workbench

Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-04-09 15:53
Updated by:
 
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.