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
-1
votes
0answers
17 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 ...
0
votes
1answer
68 views

Shows “[Utils] [ERROR] [Error] java.lang.NullPointerException” for data driven(excel File) API Automation test(Rest Assured)

It throws a java.lang.NullPointerException, but why it shows that, I could not find. Here is my code. ExcelUtil package Utils; import java.io.FileInputStream; import java.io.FileNotFoundException; ...
1
vote
1answer
27 views

Fetching wrong Employee count corresponding to office location in Selenium

I am fetching Employee count according to locating using Map Highlighted No of employees count is mismatch in Image like If i search in Web table Tokyo there count is 5 but here getting 6 for ...
0
votes
1answer
57 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
37 views

I'm using ExtentSparkReporter for generating extent reports in cucumber with testng …how to add screenshot for failure scenarios

package cucumberhooks; import java.util.HashMap; import java.util.Map; import com.aventstack.extentreports.ExtentReports; import com.aventstack.extentreports.ExtentTest; import com.aventstack....
-1
votes
0answers
35 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
1answer
37 views

TestNG - java.lang.NullPointerException [duplicate]

My code: package test; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng....
0
votes
3answers
178 views

TestNG- No tests found. Nothing was run

UTF-8 io.rest-assured rest-assured 4.1.2 test org.testng testng 6.14.3 ...
0
votes
1answer
59 views

Null Pointer Exception Error at Selenium TestNG

I'm trying to automate the search box but I'm getting null pointer exception. package LICT.Maven_ReCheck_Search; import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import ...
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
45 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
1answer
36 views

How to split data passed from a .CSV file to a TestNG DataProvider

Given my .csv data file in format name:reference :- Johnson;464758, Smith;839393, Jones;940392, Davidson;182939, Arthurs;938494 And given my test code: final static String DELIMITER = ","; ...
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 ...
0
votes
0answers
76 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. ...
1
vote
1answer
70 views

testNG, Java: How to combine a few Data Providers in one test?

in the provided test I need to read the data from the cell in Excel and it works. I would also like to add the functionality to store the price of the product in another cell in the Excel. I've ...
2
votes
2answers
143 views

Get class name of the calling class

I needed to get a class name from my calling class. I will not make too much confusion. I have 3 classes . Class A{ //do something } Class B extends Class A { @Test(dataProvider = "dp&...
1
vote
1answer
51 views

Selenium Dataprovider returns a NegativeArrayException when called from different class

I have an excel which contains multiple worksheets in it. Each worksheet contains multiple columns. I have a class like this. public class dptwo extends dpone { @Test(dataProviderClass = testdp.class, ...
3
votes
1answer
70 views

Problem implicit wait with wait.until

In my code, I want to wait a certain time until the command fails with implicit wait for the driver. I have parts which were loaded after entering the page and a loading-icon is visible. In these ...
0
votes
0answers
21 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 ...
1
vote
3answers
91 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(...
0
votes
0answers
39 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
43 views

java.lang.NullPointerException in Page object Model

I have created this program using TestNG and i'm getting this error java.lan*g.NullPointerException I have initialized the Webelement .But still i'm getting error POM.java package TestPOM; import java....
1
vote
2answers
124 views

Jenkins doesn't execute tests

I have a Maven project and I'm using TestNG. My build completes in Jenkins, but the tests I want to run from my testng.xml file are not actually executed. I have my console output from Jenkins and ...
0
votes
2answers
60 views

Is there a way in TestNG to validate something but not fail the test case at the end (not soft assert)?

I'm using TestNG to run a test and I've been using the Assert.assert statements in Java. Now there are a few places where I would like to validate whether a function returned true or not. If it didn'...
0
votes
1answer
27 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
33 views

java.lang.NullPointerException on my POM project. I have my Page factories initialized and cant figure out the issue [duplicate]

I am getting the following error message in my IntelliJ The "TestBase.java:33" and "LoginPageTest.java25" essentially both point to the if(browserName.equals("chrome")) line of code in the base ...
-1
votes
1answer
36 views

Is there any course available online on designing ui automation framework using Selenium and Java?

Is there any good course available online that explains designing UI automation framework using Selenium and Java, integrating logging, reporting, etc. ? Maybe also talk about some best practices. ...
0
votes
1answer
333 views

Getting “testng.xml is not a valid file” error in Jenkins

I’m getting the following error when trying to run a Selenium/TestNg test from Jenkins. [ERROR] Suite file /development/apps/config/jenkins/jobs/teste-automatizado/workspace/Abc/testng.xml is not a ...
0
votes
1answer
58 views

TESTNG, how to validates test case results to pass fail status [duplicate]

Need help, my question here is how can I code it such when the result is not expected testNG will display the test case as failure/fail? if the result is expected test case result is passed? very new ...
3
votes
2answers
102 views

What is the difference between BeforeClass and BeforeTest in TestNG - Selenium WebDriver

What is the difference between BeforeClass and BeforeTest in TestNG - Selenium WebDriver, please suggest me best link or site for this.
2
votes
0answers
59 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 ...
0
votes
0answers
418 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
2answers
52 views

Run appium scripts without using Eclipse or any IDE

I developed appium scripts for my Android app in Eclipse and using this IDE to execute. But I wonder there's any way to run appium scripts on other PC without installing Eclipse or any IDE. I also ...
0
votes
1answer
67 views

TestNG how to build a queue of test cases to be retried

Currently, we have logic in place which retries all the failing test cases immediately after the failure, what could be any approach where if a test fails that test should go in a queue and should be ...
0
votes
1answer
56 views

org.openqa.selenium.NoSuchElementException

here is my sript driver.findElement(By.xpath("//span[contains(text(),'Hotel Log')]")).click(); Thread.sleep(10000L); driver.findElement(By.xpath("//button[@class='btn cta-button']"))....
0
votes
1answer
495 views

Automation solution for PDF content validation using Java [closed]

I am doing POC on PDF content validation which will basically validate the content of PDF files. But I didn't find any solutions. Solution which I am looking for: Read the PDF file from a specific ...
0
votes
2answers
71 views

How to add an argument to my BaseTest ChromeDriver Instance?

I have a selenium framework with a BaseTest class. In the BaseTest class we instantiate a ChromeDriver instance which contains various arguments. These are part of the @BeforeMethod (using TestNG). My ...
0
votes
0answers
420 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 ...
-1
votes
2answers
138 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
vote
1answer
483 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
1answer
26 views

Unsuccessful Test Continues to Next Test With No Output

setUp: To save time starting/closing browser, logging in/out, I've started grouping regression tests in common classes. I know there are other ways to do this, this one made most sense for our ...
0
votes
2answers
155 views

How to rerun failed test from where they instead of from beginning? (TestNG)

Is there any way to re run the failed testcase from the page where it got failed instead of running the testcase from beginning in Selenium Java ?
0
votes
0answers
79 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
1answer
342 views

Selenium TestNG - java.lang.NullPointerException in automation testing

I am trying to test the login function to my android app. But it displays an exception error java.lang.NullPointerException. Code as follows: package tests; import java.io.IOException; import java....
0
votes
1answer
1k views

How to resolve the “java.lang.nullpointerexception null value in entry url=null ” in Selenium(POM)

1.TestCommands.java public class TestCommands { public void click(By locator,WebDriver driver){ try { WebElement element = driver.findElement(locator); element.click(); ...
1
vote
1answer
75 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
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
471 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 ...
1
vote
1answer
24 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
2 3 4 5
7