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
vote
2answers
323 views

How to add tolerance for time period using assert command in TestNG tool

I am doing regression testing. In my Aplication I am giving assertEquals() command for time period which is in miliseconds.But it has very small changes time period and my testcase failed.So I want to ...
0
votes
2answers
356 views

How to add the test cases to a test-suite file that calls other test suites in TestNG?

I have a testNG.xml file having the code as mentioned below.This file is calling 2 other test suite files- Suite1 and Suite2. But I want to add some test cases to this file as well. Can I do this and ...
0
votes
1answer
5k views

Getting error while configuring extent reports in selenium

BaseTest.java import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.Assert; public class BaseTest { public WebDriver driver=null; public Properties prop; public void ...
1
vote
1answer
219 views

TestNG reporting dynamic test cases

I have multiple Test Cases using a single test method dynamically. It it possible for TestNG to report the number of passed Test Cases and number of failed Test Cases? If it is possible, how do I ...
0
votes
3answers
1k views

Creating UI to run my 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 ...
1
vote
1answer
5k views

Showing NoClassDefFoundError after executing testng.xml file through command prompt

I am trying to execute a testng.XML file through the command prompt which I will use later in Jenkins with the batch file. Executed XML file gives me the following exceptions. C:\Users\Vinay\...
1
vote
1answer
589 views

How to display data in excel through data provider

@DataProvider(name = "Authentication1") public static Object[][] credentials1() { return new Object[][] { { "12234", " 6576","gfdgfdg"," dfg","gfd "}, ...
1
vote
3answers
22k views

How to pass the WebDriver instance to other Class in Selenium/Java/TestNG?

I have created 2 classes in 2 packages under one project and calling one method of class A into class B by creating object of class but it is giving me null pointer exception below is the code can any ...
0
votes
3answers
1k views

How to run only 1 annotated test method in TestNG ?

I have coded many Test Cases as Test Methods with @Test Annotation. I have used only one class for all methods. I want to run only 1 or 2 particular methods. And not run other methods. Please ...
1
vote
1answer
1k views

Why doesn't testNG assertion message get printed after each test in data-driven testing?

I am running Data-driven tests driven from a spreadsheet which are input to TestNG test Framework. In a nutshell, the framework traverses through outlook mailbox and looks for mails based on the ...
1
vote
2answers
12k views

what does this mean ? : Cannot inject @Test annotated Method [f] with [interface org.openqa.selenium.WebDriver]

My Code : import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.Test; import org.openqa.*; public class NewTest { public WebDriver ...
1
vote
1answer
1k views

I cannot instantiate class using TestNG and IE Webdriver

I cannot instantiate the follow class using TestNG and IE Webdriver. Can someone identify what is wrong with my source code? public class NewQATEstClassTest { //For use of IE only; Please enable ...
1
vote
1answer
445 views

dataprovider for key value pair to run same test for different dataset

I have a data file in selenium webdriver as below: [Contact_Buyer] Title = Madam Contact_language = French [Contact_Owner] Title = sir Contact_language = English I want my test to run for each ...
2
votes
2answers
620 views

Alternative ways to implement Data-Driven Testing for Selenium 3.0?

Currently I am using Selenium 3.0 with the TestNG framework and a page factory setup for maintaining the page setup. I have been using wini for fetching data from the text file using section and ...
2
votes
5answers
459 views

Managing Test Data for UI testing

I am working on a Java/TestNG UI automation framework and having some difficulties with test data management. I use TestNG's DataProvider to pass data to the test method. I need to pass about 30 ...
1
vote
4answers
3k views

How to close all the browser instances and chromeDriver.exe even if my test cases fails?

I am using testNG with selenium to write my test cases, I observed a strange problem that is When I run my test cases, and if any test case fails or any other exception occur in between the test case ...
4
votes
6answers
8k views

How to run same test case of testng on 100 different URL/Domain?

I have one difficult scenario for automation testing. I want to run one test cases for 100 different URLs/Domain. Precondition : Script is generalize and running individuality properly. Use of ...
3
votes
3answers
5k views

How does TestNG priority work for a group?

Suppose I have five test cases out of which three are grouped in "Smoke Testing" and two have not been grouped at all. If I have set priority for all my test cases from 1 to 5, will the cases from ...
5
votes
1answer
904 views

How to run a TestNG project located on Github from Jenkins?

I know how to configure batch file to run my TestNG project on local from Jenkins. But how to configure batch file command on Jenkins to run it from Git ?
2
votes
1answer
2k views

GeckoDriver error in TestNG that works in plain JAVA

The gecko driver path that works in JAVA is causing an error in TestNG. Environment: Win 10 FF selenium-java-3.0.1 geckodriver-v0.11.1-win64 eclipse-java-neon-2-win32-x86_64 I suspect I'm placing ...
3
votes
3answers
3k views

Selenium WebDriver tests sometimes doesn't find elements

I am pretty new to all the Automated Testing thing and recently I have been having trouble with selenium because sometimes fails finding certain input fields / buttons. I added explicit waits for ...
1
vote
1answer
581 views

Excel Data overite problem

I have generate testcases for the login and register page so,i want to display testresult in excel sheet but problem is that when i run testng.xml file then data is overrite into file .i want to ...
0
votes
1answer
326 views

Display error while generating excel report using TestNG

I am trying to generate excel file for displaying TestNG report into excel sheet. For that I created simple program for creating excel sheet and display static data, but it's displaying error
2
votes
3answers
250 views

How to verify the body context using Assert command [closed]

I want to pass my test.When I run my test it gets fail because expected and actual is not matching. How to do with assert command? When I copy the actual value it shows like an error: {"level":"...
1
vote
2answers
355 views

Test Automation Framework: How to integrate other project to a Black-box Automation Test Framework

I've been spending for at least 3 months building a Test Automation Framework from scratch using Selenium WebDriver(Java) and TestNG. I have adapted the concepts of page-object-model, integrated excel ...
0
votes
4answers
6k views

How to modify TestNG report?

I have generated a test suite and run the testng.xml file and default report is generated accordingly. I want to modify default generated report. I want to display one column which shows the pass ...
0
votes
1answer
816 views

How to display input data in testng report

I have generate TestNG report in eclipse to display results of fail/pass testcases, but in report it does not display which input string I had passed into textbox. So I want to display input string in ...
0
votes
1answer
344 views

How to run testcases on one browser

I have create testcases in eclipse.but while runnig testng.xml file it's open in new browser every time.how to run it in single browser.i am calling below for every testcases so it's open in new ...
1
vote
1answer
927 views

TestNG Report display Blank

I have created testcases in eclipse. I am trying to run that using TestNG, it displays output in console for fail and pass testcases, but I have open emailable-report.html from the test-output folder, ...
3
votes
1answer
7k views

Executing parallel and sequential TestNG tests in one run

We have a group of tests that can be run in parallel and a group of tests that can only be run sequentially. I would like TestNG to execute all of them in one run but schedule sequential tests ...
2
votes
3answers
4k views

TestNG cannot find parameter for test

I am using selenium webdriver, maven for dependency and java lanaguage and I'm following page object design pattern. This is my first time I am using maven. I am automating a login page. Here browser ...
3
votes
2answers
1k views

How to find broken link in Selenium, when a http page have https link and mail address in page body?

I have a http page. Can I verify any broken link when a page has no https link and mail address in the page body. Is there any way to find the broken link using selenium webdriver in java, when page ...
0
votes
3answers
677 views

WebDriver+TestNG+Eclipse, Failing of Assertion in Try block doesn't pass the debugger to catch block

Please see a simplified code below public class testClass { static WebDriver driver; @Test public void Checking() { driver = new FirefoxDriver(); driver.get("http:/...
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"...
1
vote
1answer
148 views

Error in my page

I am using selenium with page factory method to automate a login page. An error came when I try to run my code. My complete code is.. package com.docmgr.Pages; import org.openqa.selenium.WebDriver; ...
0
votes
2answers
91 views

Selenium Webdriver testNG [closed]

I have created three classes in TestNG and every time that I run my test.xml file it is then opening up multiple instance of IE. I need to do the the following activity in single browser instance :- ...
3
votes
1answer
1k views

Data Validation Testing using selenium

I am doing functional automation testing for a web application for analytics using selenium+TestNG. This application fetches huge amount of data from database and displays it on the platform after ...
5
votes
5answers
1k views

Reading locators for Testing suite from an external file

I am currently working on a building an automation testing framework using selenium+TestNG with over 1000 test cases. The test cases I am writing use a lot of elements and I was thinking is it a good ...
0
votes
2answers
3k views

TestNG +Selenium : How to resolve exception: “java.lang.IllegalStateException”?

I am getting following error when run my selenium webdriver program using testNG (Using Eclipse Kepler service release 2) Cannot instantiate class TestNG.TestNGClass at org.testng.internal....
-1
votes
1answer
73 views

Selenium Webdriver ExtentReports: Putting logStatus after every statement

I have a testcase.java which houses all the @Test methods (login, signup and forget password). Since I'm using Selenium ExtentReports, I put LogStatus.PASS after every single statement has been ...
2
votes
2answers
2k views

Selenium Test Reporting: XSLT reporting OR ExtentReports

Actually, I'm currently working on test automation to a project. I'm using Selenium Webdriver (Java) and TestNG. I have adapted page-object model in my coding and have integrated excel functionality ...
0
votes
1answer
1k views

java.lang.nullPointerException while running testcase [closed]

package automate; import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org....
0
votes
1answer
327 views

Which plugins are available for jenkins to change the test config from jenkins UI interface?

I have integrated my testNG based selenium test framework with jenkins. Currently user have to open the code and enable/disable the test cases in testNG.xml file. Now I want an interface on Jenkins ...
2
votes
3answers
608 views

Alternative to ReportNG?

ReportNG seems to be a commonly-used TestNG plugin among some of my colleagues, but it has effectively not been maintained since Sep 2, 2013. Is there some alternative that has superseded it?
1
vote
3answers
6k views

Launching and closing browser multiple times in testng

I have two scripts trying to run using testng. In 1st script launching browser at the end closing the browser. In second script again launching browser and closing at the end. But getting below ...
-1
votes
1answer
482 views

Identified xpath is not working in testng,if the xpath is in first line of the method logout. the same xpath is working without using testng

Identified xpath is not working in testng, if the xpath is in first line of the method logout. The same xpath is working without using testng. I am getting error: Unable to locate element: {"method"...
3
votes
2answers
6k views

How much time it takes to automate 10 test cases of an module using selenium

It's an Interview question: If each test case contains 8-10 lines within it. Then what would be the average time to automate them? I think it depends on the following factors: Complexity of the ...
0
votes
2answers
1k 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 ...
12
votes
3answers
13k 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.
0
votes
1answer
14k views

How to verify if a WebElement(Button,Dropdown) is enabled Using TestNG?

I have a dropdown and a button on a web page.please suggest how to verify if a WebElement(Button,Dropdown) is enabled Using TestNG framework? one more thing when we work on TestNG we have to use ...