Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
GerhardHeil Absent Member.
Absent Member.
338 views

How to set the application configuration for the Java Security Warning in SilkTest API

We SilkTest API version 18.5 (not SilkTest Classic or Workbench).

We test a web application, that might open the Java Security Warning dialog or not. If the dialog comes up, it must be confirmed. But we are not even able to check whether the dialog is present.

With "Windows Locators..." in Silk Test Classic, I got the locator of the window. Using this value, I tried:

desktop.<Window>find(locator);

expecting to get the information whether the warning dialog is present or not. But I get the exception No application configuration present.

I found some descriptions about setting the application configuration in Silk Test Classic, but they don´t help for SilkTest API.

So how can I set the application configuration for this dialog in SilkTest API?

Thanks for any idea.

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

RE: How to set the application configuration for the Java Security Warning in SilkTest API

Hi,

It looks like you are using Silk4J based on the code snippet.

Please note that you should be able to record locators directly from Eclipse if you have installed the Silk4J plugin.

The error "No application configuration present" would indicate that you have not attached to any applications that you wish to test. Generally this is done by executing a BaseState/BrowserBaseState/MobileBaseState or by explicitly attaching to the desired applications using the desktop.attach() method.

For example, if you are testing IE, execute the following at the start of the test:

BrowserBaseState baseState = new BrowserBaseState(BrowserType.InternetExplorer, "demo.borland.com");
baseState.execute(desktop);

This will launch IE at the specified URL and enable Silk4J to interact with the browser.

 

I would recommend installing the Silk4J plugin to Eclipse and then creating a new Silk4J project. This will create a project with all the required settings and resources to test your application.

-Robert

0 Likes
GerhardHeil Absent Member.
Absent Member.

RE: How to set the application configuration for the Java Security Warning in SilkTest API

Hi Robert,
great, that works.

Our existing tests open the browser via Selenium and then operate it via Silk, that is obviously possible without application context. Is it also possible to access the browser (with its Security Warning, if it came), that was opened by Selenium?
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: How to set the application configuration for the Java Security Warning in SilkTest API

Hi,

For browsers such as Chrome and Firefox, Silk4J must be the tool that launches the browser.

If you have existing Selenium code, you can access the WebDriver that Silk4J uses as follows:

SilkTestWebDriver driver = desktop.<BrowserApplication>find("//BrowserApplication").getWebDriver();

You can then execute your existing Selenium code as normal, with the added benefit of Silk4J's inbuilt synchronization.

-Robert
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.