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.

44 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
4answers
912 views

When and how to do regression testing?

I am learning selenium. I am trying to get into more and more automation. Scenario (example): We are working in the agile. 2 weeks of sprint. We have a release after every 3 sprint. In our framework ...
4
votes
1answer
2k views

TestNG: Multiple suite files are not running but single xml file is running multiple times

This is my testng.xml file: <suite name="Suite1" verbose="1" parallel="true" thread-count="5"> <suite-files> <suite-file path="xml-files/live.xml"></suite-file> ...
4
votes
1answer
2k views

Dependent methods in the same class run out of order only when included in a “testng suite”; running class independently respects the dependency

I have a class with dependent methods using the TestNG annotation dependsOnMethods The test runs fine 100% of the time if I simply run it as a TestNG Test from the package. When I include the test ...
2
votes
0answers
546 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(...
1
vote
1answer
6 views

Unable to get multiple browsers working with Chrome and IE Edge browsers

I am new to QA testing; I was practicing automating test case in TestNg but can't seem to get the cross browsers to work. The test keeps failing. It worked when it was just one browser. Any ...
1
vote
2answers
31 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
103 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
3answers
2k views

How to resolve NoSuchElementException in Selenium with java?

CODE: driver.findElement(By.name("USER")).sendKeys("XYZ"); driver.findElement(By.name("PASSWORD")).sendKeys("abc"); I have tried various ways not just name but by xpath, css selectors but every time ...
1
vote
0answers
363 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
217 views

“NoSuchElementException” while executing Selenium script with TestNG

I'm trying to search few records in 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
87 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
0answers
335 views

Couldn't able to run the testng script in Maven using cucumber

Below is the TestRunner class: import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; import cucumber.api.testng.AbstractTestNGCucumberTests; //@...
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
567 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
0answers
512 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
91 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
716 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
0answers
7 views

PackageRelationshipCollection issue in selenium

Exception in thread "main" java.lang.IllegalAccessError: tried to access method org.apache.poi.util.POILogger.log(ILjava/lang/Object;)V from class org.apache.poi.openxml4j.opc....
0
votes
1answer
27 views

gitignore of Selenium WebDriver TestNG

For selenium webdriver testng using git, what should be part of gitignore so my scripts can run on any computer without any conflict. Thanks!
0
votes
2answers
26 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
0answers
43 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" ...
0
votes
1answer
46 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
1answer
23 views

TestNG with multiple datadriven

My code structure logic is this: I have to fill three sequential forms to add a entry in a list whose data is from Excel. I need each form to have entries from different Excel sheet, i.e first form's ...
0
votes
0answers
26 views

Extent Report : [TestNG] Reporter x.x.ExtentReportListener.ExtentReport@afc191 failed java.lang.NullPointerException

Getting nullPointer exception in extent report . Help me on this issue unable to trace the root cause Using extent report 2.41.0 Here is the my log: [TestNG] Reporter com.psiexams.base....
0
votes
2answers
46 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
63 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
453 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"}) testng.xml &...
0
votes
1answer
56 views

I need to verify a dynamic table record, if they match with data then PASS else Fail the test case using Assert

Page Object Class public class Transactions { WebDriver driver; boolean result1; public Transactions(WebDriver driver) { //super(); this.driver = driver; } public void ...
0
votes
2answers
99 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
1k 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
385 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
11k 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
939 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
0answers
144 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 ...
0
votes
1answer
938 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
122 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
1answer
34 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
45 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
56 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="...."> <...
-1
votes
3answers
122 views

Getting Null pointer expections “ java.lang.NullPointerException ”

[RemoteTestNG] detected TestNG version 6.14.3 1553664942228 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "-marionette" "-foreground" "-no-remote" "-...
-1
votes
1answer
1k views

Getting error message while running selenium script

I am facing this problem, please give me a solution [RemoteTestNG] detected TestNG version 6.14.2 Starting ChromeDriver 2.42.591088 (7b2b2dca23cca0862f674758c9a3933e685c27d5) on port 7027 Only local ...
-1
votes
1answer
277 views

How do I run multiple testcases defined in different classes with two different logins using Selenium,Java and TestNG?

Example: Public class A() { Method A1 Method A2 } Public class B() { Method B1 Method B2 } I am using dataprovider to get the login info (id and password) from excel Public class login() { User1 ...
-2
votes
1answer
180 views

Page chaining in POM method

I have created three packages. generic webpage script In generic I have base test and other common methods. In webpage I created class for each web page. In Script I have my testcases. I need ...