Questions tagged [testng]

TestNG is a testing framework, inspired by the JUnit/NUnit unit testing frameworks. TestNG is intended to support more than just unit testing, allowing functional, end-to-end, integration, etc.

54 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
362 views

Using maven to create a standalone jar file that executes in any OS

I am trying to create a standalone selenium-TestNG tests Jar file that can be executed in any OS as part of CI/CD. My POM.xml is as follows: <project xmlns="http://maven.apache.org/POM/4.0.0&...
3
votes
0answers
745 views

How can I make my solution thread safe for testNG parallel execution?

Background: For quite some time I have ran automated tests using forked JVM processes, this proved quite easy when injecting a driver object using spring, I could simply provide the following: @Bean(...
2
votes
0answers
43 views

How to avoid using same data in parallel execution

This question is similar to How to manage application data when running multiple tests in parallel? But I want to know if there's a way or listener in testNG that will lock certain method when running ...
2
votes
0answers
58 views

BeforeClass doesn't get displayed in TestNG test results window

We are expanding our TestNG suite to run multiple tests. Doing so we've encountered a strange occurrence. In one suite I have two tests. Both tests have one class each. Tests in IntegrationTest.java ...
2
votes
1answer
844 views

TestNG reports email after test executions

I've found various links for sending TestNG reports to be emailed after test executions here are two of the links https://loganathan1988.wordpress.com/2014/11/03/how-to-email-automated-test-execution-...
1
vote
3answers
89 views

How to pass excel column values into different test methods of a class in Java Selenium

I have an excel which contains 4 columns with N rows. Let us say Col1, Col2, Col3, Col4 are the headers. Now I have a java class and there are 3 methods inside it. public class test(){ @Test(...
1
vote
1answer
476 views

How to select a dropdown value in Selenium WebDriver using Java appium?

I am new to Selenium, currently am working on selenium webdriver. I want to select a value from the drop-down. But I am not able to do it because of some error. Also, I want to inform you that in my ...
1
vote
1answer
73 views

In gradle 4.6, how to force all tests in a class gets executed first before moving to tests in next class?

I am using Gradle 4.6 with testng. My test suite has tests organized something like these. java class1 { test 1.1 test 1.2 test 1.3 test 1.4 } java class2 java class3 java class4 java class5 All ...
1
vote
2answers
546 views

Cannot initiate TestNG test

I'm learning to use selenium WebDriver with TestNG plugging for Eclipse and I ran into this issue where I can't execute the test case (it is unfinished but it has no compile errors nor warnings). ...
1
vote
0answers
184 views

How to launch 10 browser instances using Selenium Grid in the same machine

I'm trying to launch 10 browser instances (IE) in a virtual machine and execute same script 10 times parallelly on those browsers. I updated the IE node to have maxInstances=10" -maxSession 10 and ...
1
vote
0answers
533 views

How to control order of testNG package test execution without Priority or Dependency?

I have a package containing the tests I want to run. There are no priority or dependency setings at the testcase or suite level. <suite thread-count="1" name="reg 1"> <listeners> ...
1
vote
0answers
309 views

“NoSuchElementException” while executing Selenium script with TestNG

I'm trying to search a few records on a website. The input data is in an excel sheet and I need to write the search result into another excel sheet. And while executing the script, the screen hangs at ...
1
vote
0answers
97 views

How to extract adb dumpsys response for validation?

I need to validate few status of the android device. Can any one let me know how to extract the information from adb dumpsys and validate the responses using Java. Your help is much appreciated. Ex: '...
1
vote
1answer
1k views

How to open messaging app during one android app test case is running to fetch otp

How do I open messaging app when test case is running for any other app. Need to fetch OTP from messaging app during a test case is running for my android app. I have tried to create new instance ...
1
vote
0answers
158 views

Does it require to install all necessary software for slave in jenkins

I have built automation script and everything working perfectly. Now client want to run same script from his location. I am thinking to set his computer as slave in jenkins , but does it require to ...
1
vote
0answers
522 views

Unable to run as TestNG in Eclipse Kepler or Luna on Mac machine

I am using Mac Yosemite 10.10.3 and Eclipse Kepler (4.3). I installed latest TestNG from the official site testng.org and added it successfully from Help menu but TestNG option is not showing under ...
1
vote
0answers
96 views

Feed TestNG tests

Recently, I used feed4testng in order to run multiple instances of test using a data provider with feed4testng tool. But this tool only iterates through external resources. Is there any other tool for ...
1
vote
0answers
729 views

How to keep test cases synced with HP ALM after refactoring?

We're planning to automate test synchronization between HP ALM QC and our TestNG test cases. We want to keep them synced in the following scenarios: Test adding: When creating TestNG test, a test ...
0
votes
1answer
56 views

how to read the following data from excel using cucumber-java

Heading How to get the username and password from excel using cucumber package com.qa.excel; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.poi.ss....
0
votes
1answer
33 views

Passing arguments to a DataProvider method using TestNG

Given my data CSV file: jones;1293039, smith;2938949, johnson;1203939, clark;8293044 And my DataProvider: @DataProvider(name="data") public Iterator<Object[]>...
0
votes
0answers
43 views

TestNG Listener not working on XML

My testing XML is like below <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="...
0
votes
0answers
33 views

How to execute test cases after ide crashed

Kindly suggest if I have 100 test cases after executing 40 Test Cases my IDE was crashed. So, on the next time when I am restarting my Test Cases again the execution should be start from 41 to 100. I ...
0
votes
0answers
68 views

Not able to run my test from testng.xml file

I'm not able to run by test case from testng.xml file after run of file I'm getting that Total tests run: 0, Failures: 0, Skips: 0 but if I will try to run the test class directly then test will run. ...
0
votes
0answers
20 views

Passing Data from one Test Class to another using JUnit and TestNG

Given APITest class, in which I want to generate new customer reference no's as custRefs and add to an Array (here running 3 times and generate an Array of 3): public class APITest { private static ...
0
votes
0answers
37 views

[[TestNGClassFinder]] Unable to read methods on class

[[TestNGClassFinder]] Unable to read methods on class package.CreateCustomer - unable to resolve class reference org/openqa/selenium/WebDriver I have created a testNG program and run the program using ...
0
votes
1answer
26 views

TestNG: Go to the next test after one iteration of dataProvider

So I have two tests, one that check the sign up "test01_signIn", if it's a PASS, it goes to the the second test "test02_CheckNewsStandElements", which checks the visibility of an element of the ...
0
votes
0answers
413 views

While running TestNG program in eclipse getting error: A JNI error has occurred, please check your installation and try again

Getting JNI error while running TestNG program (that doesn't have main() function). But If trying to run the same program with same set of configuration (i.e. eclipse and java version), "Run as a ...
0
votes
0answers
408 views

How to resolve “Cannot find class in classpath: com.AES.Loginpage” error in Selenium?

I have created one java project and written a script for login to application using TestNG class. I got an error: "Cannot find class in classpath: com.AES.Loginpage" I have added jars and driver exe ...
0
votes
0answers
77 views

Looking for a java library automate third party Java-Swing application without access to the source code

I'm looking to automate a third party java swing application that my company uses. I don't have access to it's source code so a lot of the swing testing libraries like Assert-J won't work. I'd like to ...
0
votes
2answers
86 views

Element located when put in a single test case but not located when put in separate test case

I am in a weird situation where I found that my element is located when I wrote in a single test case. But as soon as I put that element in a separate test case, Unable to locate element Exception is ...
0
votes
2answers
461 views

TestNG with Eclipse: How to add main class?

How can I add main class in eclipse cucumber project. I am running cucumber feature file and using TestNG but getting error: "cannot find class in classpath" and as a resolution of this I am geeting ...
0
votes
2answers
46 views

Java Selenium: Custom Assert Message for Multiple Checkbox

I'm working with an automated script for multiple checkboxes that has dependent permissions. Given there are multiple checkboxes Checkbox A Checkbox B Checkbox C Checkbox D Checkbox E When I ...
0
votes
1answer
241 views

Unable to execute single tc, login then run other application features, right now its running as a suite

I have to execute my test cases as a single as well as a suite, right now its running as a suite but not as a single test case in selenium webdriver: Below is my test which are calling methods present ...
0
votes
2answers
83 views

How can we run only selected testcases from extent.html report in selenium webdriver?

I'am running testng suite and then extent.html report is being generated. Now I want to customize my report like; i should be able to select only failed testcases in my report and then should be able ...
0
votes
2answers
282 views

Getting nullpointer exception for 2nd test case working fine for login

Driver set to null for 2nd test case, working fine for login. Driver class: public class Driver { private static WebDriver driver;; /** * * @return * @throws Exception */ public static ...
0
votes
0answers
2k views

Cucumber and TestNG, how to pass parameter?

Could you please tell, how to pass parameter in Cucumber using TestNG? I have following code, but it does not work. Error in stepDefinition.java on the line @Parameters({"environment"}) ...
0
votes
2answers
153 views

Not able to enter case-sensitive credential in android app

I am writing a test case for an android app where the app requires case-sensitive credentials. I writing test cases using appium and TestNG. Steps I am following are - Launching app Entering ...
0
votes
1answer
2k views

Maven TestNG multiple suites in different folders

I'm working on a mobile automation task where I need to run test suites in parallel for 3 different iOS apps. Each test suite has its own testng.xml with a section configured to run on a device. I ...
0
votes
2answers
538 views

Unable to read the parameter value inside a class using TestNG

To achieve parallel execution, I am updating my existing Junit project to TestNG. The requirement here is to run one scenario in different browsers using TestNG RunnerClass is as follows: import ...
0
votes
2answers
13k views

Selenium IE Webdriver showing “Only Local connection are allowed” in TestNG

I am trying to launch my application in IE browser in selenium using TestNG framework. But, after the IE browser is launched, the Eclipse console shows an error that "Only Local Connection are allowed"...
0
votes
2answers
2k views

Can we access the value of a member or class variable of a test class in the testListner methods

I have a situation where 'xyz' is member variable of my testClass and I want to print some information in my report using that variable only. So I want to access 'xyz' in my 'onTestFailure' listner ...
0
votes
1answer
1k views

Import TestNG results from Jenkins to ALM

I have Jenkins on localhost, configured test project, which is generating passed test: @Test public void aFastTest() { System.out.println("---- ---- ----"); Assert.assertTrue(...
0
votes
0answers
3k views

TestNG with Selenium Data and Keyword Driven Framework

I am new to TestNG. I'm using Hybrid Framework For Automation Testing, it's Hybrid Architecture based, in which Keyword(Java Methood name) and data is provided in Excel sheet, and based on that ...
0
votes
3answers
1k views

Test cases stop execution for next test cases after using soft assertion

I have used soft assertion in my test cases, but it stops the execution of all the next test cases. what I know if we are adding soft assertion then particular test case should fail and it should jump ...
-1
votes
0answers
9 views

PageFactory.initElements give a null to webe elements in selenium

I am designing this framework to automate a web application using selenium and java. I have implemented bass class, object class and test class separately. even though I initialized the page factory ...
-1
votes
0answers
34 views

What is the reason of test method getting skipped?

I am trying to execute a test method multiple times in parallel against test data read using @Dataprovider. For example: There are 3 sheets in my .xls file and I am executing the same test in parallel ...
-1
votes
2answers
135 views

Getting java.lang.NullPointerException while trying to instantiate the Webdriver driver under @ Annotation

Please find the code below and let me know why am I getting NullPointer. I am having no clue. package com.seleniumhybridframework.utility; import java.util.concurrent.TimeUnit; import org.openqa....
-1
votes
1answer
108 views

Extent reports issue in maven project

I am using extent reports in my project but it is showing me error and I am not getting solution for this error: [RemoteTestNG] detected TestNG version 6.14.3 Starting ChromeDriver 75.0.3770.140 (...
-1
votes
1answer
339 views

How to assert links count on web page through selenium webdriver

I have written below code in a separate class to count links on a particular webpage, How to assert this in a test case class: public static void navigateToLinkInHomePage() throws Exception { ...
-1
votes
2answers
75 views

How locate dynamic text field element inside dialog box?

I tried to using absolute xpath to locate the dynamic text field element after search but it fails. <div class="pzbtn-rgt" data-click="..."> <div class="pzbtn-mid" data-click="...."> <...