Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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.

-1
votes
3answers
38 views

How to click on the image inside a grid using selenium webdriver?

I have to click on an image inside a grid. Grid elements have dynamic ID's. Therefore it's impossible to capture elements as usual. How can click on this image? I have boxed the image I ...
-2
votes
0answers
17 views

An error occurred while I using testNG

SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/huang/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.5/log4j-slf4j-impl-2.5.jar!/org/slf4j/impl/...
1
vote
0answers
20 views

How do you get Jenkins to count the build run as pass when failed testng tests are retried and passes? [duplicate]

How do you get Jenkins to count the build run as pass when failed TestNG tests are retried and passes? Description: I have two tests that ran. Test1 passed, but Test2 failed then on retry it passed....
1
vote
2answers
52 views

How to automatically rerun failed TestNG tests on Jenkins and update the final results to pass if retries passes?

How to automatically rerun failed TestNG tests on Jenkins and update the final results to pass if retries passes? Description: I have two tests that ran. Test1 passed, but Test2 failed then on retry ...
0
votes
0answers
18 views

Not able to run selenium scripts from Jenkins

I am running selenium scripts using eclipse.Now I want to schedule it using jenkins. Which are the jars apart from selenium jars should I place in my project lib folder and what should be the content ...
0
votes
1answer
21 views

TestNG + Appium + Java : [TestNGClassFinder] Warning: Can't link and determine methods of class

Question: How to fix : [TestNGClassFinder] Warning: Can't link and determine methods. More info: My Automation is getting failed suddenly. I know it was working well before & even yesterday. ...
1
vote
1answer
29 views

How to control TestNG to iterate all Tests in each iteration instead of iterating individual tests before moving on to the subsequent test

Problem - I have 6 tests and one dataprovider with 2*2 object array. I want TestNG to pick first data, use it in First test and then subsequent tests are executed based on the data picked in first ...
0
votes
1answer
107 views

Selenium Webdriver TestNG (Java) using While loop for all tests

I am new to Selenium Webdriver Testng and trying to Develop Data Driven framework using CSVReader I have 5 tests in Testng and have to run those all on different environments. So basically I have to ...
0
votes
1answer
25 views

Dynamic Tests using TestNG selnium arrays

What is the best approach of the follwoing scenario. I have to run a number of tests which take in dynamic data. The first set of values are pretty standard but then one is dynamic and can be any ...
0
votes
0answers
135 views

how to execute batch file of TestNG class of maven project

I am trying to execute a batch script for my testng class of maven project. Can anyone provide a solution for fixing the error? The scenario is When I try to run my Specific TestNG class without ...
1
vote
3answers
70 views

Multiple @tests but did not execute the priority 2 and priority 3

Can someone let me know why it stops execute after the first @test(priority=1)? It ran the @beforeclass, then @test(priority 1) then @aftermethod. So it skipped @test(prority=2) and @test(priority=3) ...
0
votes
1answer
47 views

How to Create “Runnable jar” testng file for deployment?

I tried: TestListenerAdapter tla = new TestListenerAdapter(); TestNG testng = new TestNG(); List<String> suites = Lists.newArrayList(); suites.add("testng.xml");//path to xml..in src testng....
0
votes
3answers
60 views

Why my code is not working when I click on the same button for multiple times?

I have same Skip button types kept for 99 products. When I need to click that, it will bring a popup. In the popup I need to click the Cancel button. Each time when I click on the Skip buton it will ...
0
votes
2answers
44 views

Is it possible to store value, return it and validate in another test case by calling previous method

I have created a method which is as follows: @Test(priority = 61) public void Schedule_Valid_Promocode_Discount () throws InterruptedException { WebElement Discount = driver.findElement(By.xpath("...
1
vote
2answers
114 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 ...
1
vote
1answer
41 views

java.lang.nullpointerexception

lang.nullpointerexception while running the below code. package aditi; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.concurrent.TimeUnit; import ...
0
votes
1answer
17 views

Automated Test Framework for testing Data provided in two files

I would like to develop an automated test framework for testing/verifying the data model of a Desktop application using Java. Basically, the approach I would like go for is to retrieve the data in to ...
1
vote
1answer
347 views

testng.xml is not executing when we run pom.xml for maven project selenium

While executing my pom.xml file through maven test my BUILD is getting SUCCESSFUL but my testng.xml is not executing. I tried with executing 13 classes and with single class for both the time it ...
1
vote
0answers
179 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
3answers
104 views

Is it possible to test dynamic web sites using selenium?

I have a dynamic web site which is developed using angular(front end). Elements cannot be identified using ID,name etc... as they are not used to name elements. But models have used to name elements ...
0
votes
2answers
42 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
0answers
54 views

Selenium Java + TestNG with TFS integration-

I have my selenium code in Java with TestNg framework (used Eclipse as code editor), but now I need to integrate it in TFS. I am very new to TFS but I have seen many ppl told it is possible so if ...
1
vote
0answers
106 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> ...
0
votes
1answer
132 views

Order of execution for Tests in TestNg, If Priority set only for few Test Methods

I have three methods as mentioned below, two with priority ( 0 , 1 ) and third method(Test) with no priority attribute. What is the order of execution. Code snippet given below.. @Test(priority = 1) ...
0
votes
3answers
181 views

How to solve java.lang.NullPointerException error in button click event?

I'm using Java,Selenium web driver and TestNG framework. I have a method to click a button in web page. But it didn't work. When debugging I could find xpath is not passed to the button. Then I tried ...
0
votes
2answers
77 views

How to find a button using both xpath and button text?

I have three buttons withing a div. All three buttons belong to same class (class names are same). What I want to do is capture each button using its text (Buttons have different texts) and xpath of ...
0
votes
1answer
313 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
1answer
89 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
1answer
38 views

Appium - test scripts are not executing on new activity

I am performing a sign in operation on the Android application using appium test scripts. The test scripts doesn't execute the lines of code related to the new activity. It works on debug mode or ...
-2
votes
1answer
79 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 ...
1
vote
3answers
1k views

How to print a message after checking through TestNG's Assert.assertEquals method?

I'm getting a string value from a function. Now I want to print a message saying whether expected string and actual string are different or not. To compare these string I'm using TestNG's Assert....
1
vote
1answer
37 views

When submitting a form by fetching values from excel file it is showing Internal Server Error

When submitting a form by fetching values from excel file it is showing Internal Server Error but when I put static values in code and run it successfully submits the form without any error. Here is ...
0
votes
1answer
301 views

Getting 'nullPointerException' in @AfterMethod [closed]

Code: import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.AfterMethod; import org.testng....
0
votes
0answers
58 views

While generating XSLT Reports it is showing “testng-results.xml does not exist” need help to figure out if I am missing something

C:\Users\mc\eclipse-workspace\XSLTPractice>ant generateReport Buildfile: C:\Users\mc\eclipse-workspace\XSLTPractice\build.xml generateReport: [delete] Deleting directory C:\Users\mc\eclipse-...
0
votes
0answers
295 views

TestNG with cucumber parallel runners, how to use a listener?

I use a parallel plugin for building out testNG runners for cucumber scenario/feature files. This creates a ton of customised runners in /target as part of the maven lifecycle. How can I use some ...
1
vote
0answers
150 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
4answers
247 views

Assertion message with TestNG

I use TestNG for assertion, for example with this assertTrue: Assert.assertTrue(boolean b, String s) If the assert is failed, then the String s will be printed out, and if assertion is passed, then ...
1
vote
2answers
59 views

Selenium WebDriver: Should all @Test modules connected to each other?

1. Should all automated test modules connected to each other ? Like, when I have a @Test module for Registration, after executing that module, can I connect this test to @Test Login, @Test Login to @...
1
vote
2answers
174 views

Selenium: Getting error with webElement or Webdriver “Drive” Variable

New to automation. Help is greatly needed Anybody could help me with following code Why i am getting NullPointerException? Error: Null pointer access: The variable driver can only be null at this ...
0
votes
0answers
377 views

Due to TestNG versioning in Eclipse Oxygen Test cases are not running

I am using TestNG 6.8.5 with Spring. While running the test cases eclipse console gives following exception: [RemoteTestNG] detected TestNG version 6.8.2 org.testng.TestNGException: Cannot ...
1
vote
2answers
536 views

Can't use if condition using selenium webdriver

I've got the following situation: I want to fill a field which is displayed some times and others don't. So, to solve this I used a if condition along with page objects. public static WebElement ...
0
votes
1answer
102 views

Remove tests that were not executed from Allure report

While running test I use different test-suites (xml files with list of tests to execute). E.g. I need to run smoke-tests so I choose corresponding xml with simplest tests (login/logout; selecting main ...
1
vote
3answers
887 views

How to test using one excel dataprovider in TestNG for multiple test cases

I created a testdata in Excel with multiple test cases. Ex: #UserName# #Password# #PhoneNumber# invalidUsername validPassword validPhoneNumber vaidUsername invalidPassword ...
0
votes
0answers
75 views

Verify Login testcase while performing @BeforeMethod as the login?

I have a test suite that verifies a website that has a login. I have made the @BeforeMethod that does the actual Login before each method, but meanwhile I would like to verify if the Log In is working ...
0
votes
3answers
92 views

Cannot set Screenshots on test Listeners - selenium

I am creating TestFramework and want to set in TestListener class the method which take screenshots but during failed test the Browser closes, another browser is opened and the screenshot is created (...
0
votes
0answers
19 views

Retrieving Test Case Data on BeforeInvocation

I am trying to implement some logic to decide whether if a test case should be ignored or skipped. I have tried a couple of listeners provided by TestNG and feel that IInvokedMethodListener might work ...
0
votes
2answers
580 views

How to use dependency in TestNG with two test cases from two different classes?

How to use dependency in TestNG with two test cases from two different classes? For Example, I have two classes: package com.test.class public class A{ @Test public void testA(){ } } ...
-1
votes
1answer
49 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 ...
1
vote
1answer
62 views

Working with multiple clients/languages/sites

I would like to ask what a good solution to working with clients that have different websites. My first one is how to deal with languages? Do I create separate tests? for 125 different clients? Are ...
0
votes
1answer
1k views

How to Launch multiple Chrome Browsers in Parallel using TestNG

I need to automate the two Web applications in parallel and that needs to validate in Chrome browsers. So I have two testng XML files(testng1.xml and testng2.xml), my scenario is to launch one ...