vikasvoladri Absent Member.
Absent Member.
5184 views

Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution

Hi all,

I've developed automation scripts using Selenium and TestNG. Can we integrate developed automation scripts with manual test cases documented in slik central. My Client wants to kick start the execution of automation scripts from Silk Central it self. 

I've made some ground work and got to know that Silk central supports Junit. Please let me know how to run the scripts developed using TestNG.

Please provide me useful links for performing above mentioned requirement like running testng scripts, configuring Default execution server etc.,

0 Likes
1 Solution

Accepted Solutions
Highlighted
maximilianp Absent Member.
Absent Member.

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution

Hello,

I have tried to run simple TestNG tests on Silk Central too and get the same error.

As far as I remember, TestNG execution was never supported directly.

Could you please open a support ticket (enhancement request) on this?

thanks

0 Likes
13 Replies
vikasvoladri Absent Member.
Absent Member.

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution

Please reply guys, it's bit urgent.

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution

Hi,

Can you please clarify/explain following part a little bit more - "Can we integrate developed automation scripts with manual test cases documented in slik central."

What is the relation to the manual test here?

Beside that Selenium and TestNG should be basically executable via the JUnit test type.

Regards,

Florian

Product Owner - Silk
0 Likes
vikasvoladri Absent Member.
Absent Member.

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution

Hi Florian,

Thanks for reply. I'm referring to adding of Junit test for every manual test case, Apologies for confusion.

I could run simple Junit test script using Junit Test step of slik central. Then i tried to run simple TestNG test script using Junit Test Step of silk central, I got following error message:

Detected java version "1.7.0_60". Informational
~poc.SeleniumSuite_Modified#initializationError: No runnable methods

In My simple TestNG test script i've used annotations and assertions of testng. In Class path I've given the path to Junit jar, TestNG jar, Selenium jar and path to my test case file.

Do i need to perform any other steps while running TestNG Test Script via Junit test type of silk central? Please refer to below screenshots:

0 Likes
Highlighted
maximilianp Absent Member.
Absent Member.

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution

Hello,

I have tried to run simple TestNG tests on Silk Central too and get the same error.

As far as I remember, TestNG execution was never supported directly.

Could you please open a support ticket (enhancement request) on this?

thanks

0 Likes
vineeth1 Absent Member.
Absent Member.

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution
DO they support Testng now (2017)?
0 Likes
MichealL Absent Member.
Absent Member.

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution
Silk Central now has a runner that allows you to run your TestNG scripts in Silk Central. This plugin is custom so it has limited support as it is not part of the official Silk Central product, so it is currently provided as is (unofficial) plugin for the application.

If you would like a copy of the the TestNG runner please log a case through SupportLine.

We will provide you with the instructions you need to install and run this in Silk Central.
0 Likes
rekhasunkara Absent Member.
Absent Member.

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution
I am currently using SilkCentral 16.5

I have created a selenium project with keywords and uploaded the keyword library from eclipse silk central configuration capability. I am successfully able to run the test as in the web driver has opened the browser and finished all steps....

BUT....silk central is unable to identify the job completion and keep showing Running <Test name>

From the above:

1. Doesnt seem like you are using junit anywhere...if so...can you help me know which version of junit silk central 16 uses

2. How does silk central know job has finished? when the last keyword has completed and entire test has no errors?

3. Does the selenium tests needs to be run as junit test type even though underlying its keyworddriven java test case methods?

any help would be highly appreciable as I am spending days together to understand the silk central test case statuses.
0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution
0 Likes
rekhasunkara Absent Member.
Absent Member.

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution
Hi

Thanks for an immediate response. I couldn't reply back over in the other thread so replying here...I am sorry

From yesterday till today....This is what I have experimented on:

1. Successfully implemented the selenium webdriver scripts as
junit type () , placing the jars in the classpath and files having @Test annotation
keyworddriventest, uploading the library directly from silk4j eclipse and files having @ annotation.

I was using driver.close() but as per the blog, I have changed it to driver.quit() though there isn't much functionality difference.

Based on my experience, in order to run the selenium webdriver scripts, scripts doesn't need to be JUNIT based...is that 100% true or am I still missing something in my research/learning?

I couldn't see any truelog entries like CLICK, ENTER etc....like I saw when I used the browserbasestate with nonselenium based scripts. Do I need to do implement rest api as mentioned in the below URL BUT I am using just the Webdriver and not the RemoteWebDriver

final File file = new File("//emedslkalb902/SCTMWorking/Properties/chromedriver.exe");
System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
driver = (WebDriver) new ChromeDriver();

documentation.microfocus.com/.../index.jsp
0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution

There is no need to use any JUnit for your keyword library. You could use JUnit for verification to fail tests:

 @Keyword
 public void junitAssert() {
   assertTrue("Assertion message", false);
 }

You need to get the WebDriver from Silk4J to get a TrueLog:

 private final Desktop desktop = new Desktop();

 @Keyword(value = "Start application", isBaseState = true)
 public void start_application() {
   new BrowserBaseState().execute(desktop);
 }

 @Keyword
 public void click() {
   WebDriver driver = desktop.<BrowserApplication> find("//BrowserApplication").getWebDriver();
   driver.findElement(By.linkText("Borland Sample Web Service")).click();
 }

Is your keyword-driven test still hanging?

0 Likes
rekhasunkara Absent Member.
Absent Member.

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution
Keywords test arent hanging anymore.....not sure if its some glitch on the server/script that made it hanging...

I have been trying to implement webdriver with desktop but everytime I use

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

method getwebdriver says its undefined for the browser type Browserapplication.

From this page. i see that I need to add webdriver capability under silk4jtools....but in my eclipse I only see remove silk4j capability

documentation.microfocus.com/.../index.jsp

I sincerely appreciate your help in regards to this.
0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution
It seems that you have Silk Test < 18.0. WebDriver support was added in 18.0. You will need to upgrade to have truelog for your Selenium scripts.
0 Likes
rekhasunkara Absent Member.
Absent Member.

RE: Integrating Selenium scripts written using TestNG unit test framework with Slik Central

Jump to solution
Sad to hear that

I do have Silk Test 16.5

Do you suggest any work arounds like getting hold of the truelog api and applying to web driver?
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.