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

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.

0
votes
1answer
28 views

Where to initialize TestNG TestContext

I have a TestRunner class that starts my TestNG like this: TestRunConfigs configs = TestRunConfigs.parseCommandLine(args); TestNG testRunner=new TestNG(); testRunner.setXmlSuites(getXmlSuites(...
0
votes
1answer
35 views

Web Service Testing Site

I practice web services testing but I don't have any web service testing site. Could anyone please suggest a good web service testing site? Please help. Thanks in advance.
0
votes
1answer
44 views

how to run same testcase in 2 different URL in selenium JAVA [on hold]

How do I run the same test case in 2 different URL which has same functionality
-1
votes
1answer
43 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 ...
0
votes
1answer
42 views

UI for automated tests

I run my test using Java, Selenium and TestNG. When I execute my test suite I have it set up where the testng.xml has all the configurations to run my tests. I am wondering, if I can set up some UI ...
0
votes
1answer
28 views

Can't able to run TestNG its show an error below I mentioned

[RemoteTestNG] detected TestNG version 6.14.2 org.testng.TestNGException: Cannot instantiate class testing.test at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:30) ...
0
votes
1answer
37 views

Simplifying Setup of TestNG/Selenium WebDriver Test Classes (using Google Guice?)

I am developing test cases using Selenium and TestNG, and am following the Page Object Model design pattern. Currently, my page classes look like this (Page1 is just a placeholder, they all have ...
0
votes
1answer
55 views

Taking screenshot on test failure (Selenium WebDriver/TestNG)

I am using Selenium WebDriver and am looking to have the driver take a screenshot upon test failure. For this purpose, I am using the following code for the onTestFailure() method of my TestNG ...
0
votes
1answer
39 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
49 views

POM Model -Fetching mobile number from excel sheet like 9.5512395512E9

Working on Page Object Model by using Data driven Framework, fetching data from Excel sheet.When executing the test script the mobile number displays like 9.5512395512E9. In excel sheet Original ...
0
votes
2answers
59 views

How to pass the web driver instance from one testcase class to another testcase class in TestNG?

InitializeDriver.java: public class InitializeDriver{ WebDriver driver; public WebDriver getDriver() throws Exception{ driver = new FirefoxDriver(); System.out.println("Initialize ...
0
votes
1answer
263 views

org.testng.TestNGException: Cannot find class in classpath: com.facebook.qa.testcases.LoginPageTest

[RemoteTestNG] detected TestNG version 6.14.2 org.testng.TestNGException: Cannot find class in classpath: com.facebook.qa.testcases.LoginPageTest at org.testng.xml.XmlClass.loadClass(XmlClass....
0
votes
2answers
45 views

I got the following error while automate the webpage using testNG

package browserhandling; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa....
0
votes
3answers
75 views

Print all product details in search results using Selenium Java

I am trying to print product details from searched results from this page. This is the function I used for that. @Test(priority = 1) public void printSearchItem() { // print the product details ...
-1
votes
1answer
68 views

How to format TestNG reports in second not millisecond ?

I want convert the milliseconds to seconds in TestNg emailable report. Please help?
1
vote
1answer
251 views

TestNG not executing all tests in suite

TestNG fails to execute all of my tests. XML file looks like this: <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Guru Test Suite"> <parameter name="...
-1
votes
3answers
95 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 ...
1
vote
0answers
32 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....
2
votes
2answers
227 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
1answer
62 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
129 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
399 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
34 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
492 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
404 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
241 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
71 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
132 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("...
3
votes
2answers
325 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
52 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
18 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
1k 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
2answers
582 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
166 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
60 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
97 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
209 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
1k 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) ...
1
vote
3answers
371 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
445 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
785 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
184 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
43 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
98 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
4k 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
55 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
768 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
96 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
596 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
282 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(...