
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Silk Central Error : java.lang.RuntimeException: No application configuration present.
Hi,
I am facing an error in Silk Central " java.lang.RuntimeException: No application configuration present." when i am running an keyword driven test of type silk4j
Steps"
- My java function start_application() is running fine when i am running from my local eclipse- Run as Keyword driven test. Before i ran this test i have setup Chrome as Browser in Silk4J "Edit Application Configuration" section.
- Then i upload this lib to Silk Central and ran a keyword driven test.
- Faced an error in Silk Central: java.lang.RuntimeException: No application configuration present. Seems it's not get the "Dialog" box at first line from my code which i have found from error stack trace
10/08/2018 +0530 17:35:51.372 at xx.xx.xx.login.xxxxxx.start_application(xxxx.java:39)
- Then I removed the yellow highlighted code and upload the Lib again to Silk Central and it worked fine.
My requirement is that i have to close all browser and open a new browser before start test. Can someone please share some thought on this.
My java class
private Desktop desktop = new Desktop();
@Keyword(value = "Start", isBaseState = true)
public void start_application() throws IOException {
//close all browser component on following order and start new browser
List<Dialog> dlgs = desktop.<Dialog>findAll("//Dialog");
List<BrowserApplication> bAs = desktop.<BrowserApplication>findAll("//BrowserApplication");
dlgs.stream().forEach(d -> d.closeSynchron());
bAs.stream().forEach(b -> b.closeSynchron());
List<Window> wnds = desktop.<Window>findAll("//Window");
wnds.stream().forEach(w -> w.closeSynchron());
//BrowserBaseState baseState = new BrowserBaseState("silk4j.settings");
BrowserBaseState baseState = new BrowserBaseState();
baseState.setBrowserType(BrowserType.GoogleChrome);
baseState.setConnectionString(
"chromeOptions="
+ "{"
+ " \"prefs\": {"
+ " \"profile.default_content_setting_values.automatic_downloads\":1,"
+ " \"download.default_directory\":\"C:\\\\Users\\\\XXXXX\\\\Downloads\\\\Silk4JDownload\","
+ " \"download.prompt_for_download\":false"
+ " }"
+ "};");
baseState.execute(desktop);
Thanks,
Silk4j

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
BrowserBaseState.execute() should be called at the very beginning of the test - otherwise the browser is not controlled by SilkTest and cannot be closed (when running locally, the browser is already hooked by the SilkTest OpenAgent).
Remove the yellow code and start the test with new BrowserBaseState()...
If you need to make sure, the browser is not running before you start the test, I would use a Setup Test to do so. Use a ProcessExecutor Test to shutdown any running browser (e.g. > taskkill /F /IM chrome.exe /T ).
Regards,
Matthias