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.

Filter by
Sorted by
Tagged with
0
votes
0answers
124 views

Facing error java.lang.RuntimeException: java.lang.NoSuchMethodException: jdk.proxy2.$Proxy9.proxyClassLookup() on run appium with POM

Hi everyone im facing this error on run appium with POM here is complete error java.lang.RuntimeException: java.lang.NoSuchMethodException: jdk.proxy2.$Proxy9.proxyClassLookup() at io.appium....
0
votes
2answers
196 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
2answers
3k 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 ...
15
votes
4answers
26k views

Is it possible to automate drag and drop from a file in system to a website in selenium using TestNG

Is it possible to automate drag and drop from a file in system to a website in selenium using TestNG? Same as we do in Gmail where we can send attachment by drag and drop operation? please suggest.
-2
votes
0answers
17 views

Screenshot doesn't show in my testng report in jenkins

I am giving them the absolute path to show the images. This works in Eclipse, but once I try to run it in Jenkins, it crashes. I have error images. Is there no way to call my images other than using a ...
0
votes
1answer
22 views

Override Static Method for TestNg Class

Is there a way to add a screenshot in this Assert method? When my softAssert fails, I need it to take a screenshot here. Method of Assert.class : static public void fail(String message) { throw ...
0
votes
0answers
13 views

ScreenShot when failed not taken Selenium

I am trying to take a screenshot of the page when an exception is triggered. My main Class : @Listeners(CustomListener.class) public class AjoutPanier extends Base { @BeforeTest public void ...
0
votes
1answer
57 views

TestNG parallel execution get failed becouse im using same WebDriver on all tests

There is a situation where I have 150 test cases and I have set up Test NG parallel test execution. Unfortunately, I'm using the same web driver which initialized at the test base class on all the ...
1
vote
1answer
180 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 ...
0
votes
2answers
101 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
1answer
246 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
131 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
1answer
31 views

Why dont we use the main() method in TestNG class?

public class Tests{ @Test public void run(){ sop("this is test method 1"); } } How will Jvm know about entry point of the program? 🤔
2
votes
2answers
82 views

Is it necessary to Assert web page title in every case?

I am writing a script in Selenium and TestNG to automate Add User profile pages. Now, when I land on every new page, then do I need to write Assert.equals("add user profile", driver.gettitle(...
1
vote
0answers
37 views

Selenium- Parallel test case using testng not working correctly. The same working fine in sequential mode

The driver instance initializes as Threadsafe. Till the launching of the browser and pass the URL everything seems to be working. But the credentials passing on anyone's browser, instead of all ...
0
votes
0answers
35 views

I am not able to open Extent report that was generated at a specific timestamp when the Test ends?

I am trying to run a Cucumber Selenium project which is written in Java and use Test NG to run the Suite. Now, in the @AfterSuite Method, im trying to popup the Extent Html and pdf report both ...
0
votes
3answers
54 views
1
vote
4answers
14k 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
1answer
1k 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 ...
0
votes
2answers
15k 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
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
1answer
19k views

TestNG like unit testing framework in C# (C sharp)

I am trying to create data provider in C#. However, I don't want to connect the DB. I just want to provide some values. Is there TestNG like unit testing framework in C#, which can I use? Is there any ...
0
votes
1answer
3k 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
1k 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
3answers
3k 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 ...
0
votes
2answers
109 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
37 views

Jenkin fail without explanation running tests process exitcode 143

I have multiple test suites running on jenkins, however there is only one which never completes. It gets interrupted but never shows why The only thing I see in my console of the build is this: 04:13:...
1
vote
2answers
188 views

How to automatically execute failed testing cases on Jenkins using extent report

I'm looking for a solution to execute failed test cases automatically on Jenkins. I'm currently running test cases through pom.xml which points to testng.xml I'm using extent reports to capture and ...
4
votes
9answers
66k views

Cannot get a STRING value from a NUMERIC cell. How can I resolve this issue in selenium webdriver using POI?

I am trying to read data from an excel sheet and write on my application.But shows an error while trying to pass a numeric value using string. Please suggest me how can I resolve the issue. Please see ...
0
votes
2answers
157 views

How can I run a login test for 100 users at the same time using Selenium, TestNG and Cucumber? [closed]

I am a newbie in Automation testing. I have a list of 100 users in a excel spreadsheet: User1: userid1/password1 User2: userid2/password2 ... and so on. I need to create a script and make all 100 ...
-1
votes
2answers
333 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
11 views

Running testNG suites dynamically_code just pick up same tesng.xml file every time

I'm using below code to dynamically load and run, testng.xml suites via, tCaseName variable(who's value is coming from excel file). I have 2 testng.xml files, who's name i have renamed to some ...
2
votes
2answers
7k 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 ...
0
votes
2answers
31 views

Seeing NullPointerException on running TestNG Selenium Framework

Written the Test Script in TestNG framework where the Open browser activity is happening in "baseClass" under @BeforeTest annotation and the Test Script is written in Test Packages under as @...
0
votes
0answers
68 views

When Tests Execute Randomly and in alphabetical order in TestNG?

When in TestNG, the @Test methods execute randomly and in what case they execute in alphabetical order? I have not using any priority tags or grouping tags either as parameters or as xml tags. https://...
0
votes
1answer
155 views

Custom Test Case Name in TestNg HTML reports

I am trying to override the test case name in the testNg HTML report since I am using the data provider and each test data depicts something different. To do this, I added the following: I am setting ...
0
votes
0answers
94 views

Build run test cases twice in Jenkins (Build now) with Maven Testng

Problem statement: Build run test case twice in Jenkins Build. working fine in the local environment Skills/Tools: Java, Maven, TestNG, Jenkins. I have tried removing testng.xml test classes. Don't ...
2
votes
1answer
60 views

How to debug TestNg Test Execution getting crashed due to large number of test cases

I have a test suite having 10000+ test cases, and as all these test cases run under one suite (Regression Suite), my suite getting crashed always due to very high memory consumption, maybe the size of ...
2
votes
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 ...
0
votes
0answers
245 views

Anyone had success running TestNg with Java 9 or above?

Has anybody successfully run the TestNG with >=Java 9? I tried and it failed. I also had no luck finding any helpful information from Google search. This is the error I got, Error occurred during ...
1
vote
2answers
390 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[]> custDataProvider(){ ...
2
votes
2answers
2k views

java.lang.UnsupportedClassVersionError -CucumberJvm4SMFormatter -Java runtime Version error

My testing framework is built with Cucumber, TestNG, Java 1.8 and Maven I recently updated my IntelliJ IDE Details: IDE : IntelliJ IDEA Ultimate 2020.3 - Runtime version : 11.0.9 Cucumber is ...
1
vote
1answer
42 views

How to retrieve test method status and other values in IReporter implementation

I need to retrieve test method status, actual result, expected result & other attributes in IReporter implementation. Is it possible to use ITestResult to pass required data to generateReport() ...
0
votes
3answers
48 views

How to have just one pre-requisite check in TestNG for multiple tests distributed across classes

I have a Test Automation project using TestNg. I want to make sure certain configurations are enabled before I start some of the tests. I have written this as a test and marked other tests as ...
1
vote
1answer
298 views

@BeforeMethod/@AfterMethod(onlyForGroups) methods did not execute, if a test method belonging to this group is executed

I am running a test suite with the test methods belonging to a certain groups. Below is the Selenium code: public class BaseClass { @BeforeMethod(onlyForGroups = {"P1"}) public void ...
0
votes
1answer
2k 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....
1
vote
1answer
153 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
1answer
184 views

TestNG: @BeforeMethod/@AfterMethod methods having no groups assigned are executed for the test method which have groups assigned

I am trying to run all the test methods irrespective of whether they belong to any group or not. Below is the Selenium code: public class BaseClass { @BeforeMethod(onlyForGroups = {"P1"}...
9
votes
4answers
23k views

TestNG vs Robot Framework - pros and cons

What are the pros and cons of using Robot Framework with selenium2Library (webdriver). Which one is the better option for web application testing - TestNG or Robot Framework?
0
votes
1answer
3k views

Maven is not running any tests called using testng suitexml files in POM.xml

I am trying to run a test using Maven by providing the testng.xml file. It is not running any test, although the build is successful. POM.xml <project xmlns="http://maven.apache.org/POM/4.0.0&...

1
2 3 4 5
8