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
1answer
413 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
570 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
422 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
5answers
7k 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
4k 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
864 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
2k 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
452 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
286 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
222 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
330 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
5k 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
773 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
283 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
833 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
6k 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
554 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
10k 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
146 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
89 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 :- ...
2
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
266 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
577 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
5k 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
440 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
5k 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
888 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
11k 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
13k 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 ...
1
vote
1answer
1k views

Rerun failed tests with TestNG

I recently migrate from Junit to TestNg. Currently, I try to understand how to rerun the failed test. According, I've just to run my test suite then recall TestNG with the testng-failed file. Easy. ...
3
votes
3answers
397 views

How to implement a lock in Selenium with Java?

I want the Script to Openfile.exe only if the previous one i.e CreateNew.exe has finished executing. Right Now whats happening is, when I run TestNG.xml file it runs all the @Test priority wise and ...
1
vote
1answer
583 views

Java + TestNG - How to resolve ”has a @Test annotation but also a return value: ignoring it. Use <suite allow-return-values=”true”> to fix this”

I execute tests, while I observed ”has a @Test annotation but also a return value: ignoring it. Use to fix this” and execution terminated. [My Env - Java + Maven + TestNG ] Any idea how to resolve ...
3
votes
2answers
1k views

How to Pause your script in selenium untill your Autoit script gets completed?

I want Selenium to wait untill and unless Autoit Script is completed. Right Now whats happening is When I run TestNG.xml file it runs all the @Test Priority wise and within 5 sec TestNg output ...
4
votes
2answers
213 views

How does TestNG influence on project performance?

The task is to measure changes in performance of a system during daytime execution. Test system description Tests are performed on java desktop application which is started with cmd command: java -...
1
vote
2answers
2k views

Running TestNG XML from another project

Is it possible to run a testNG XML from java code, in a separate java project with the given path to the XML?
1
vote
1answer
1k views

Tools for Data Driven and Keyword driven tests in selenium with python?

I am new to selenium and python, I was watching some videos on data driven and keyword driven tests, the instructor was using TestNG with selenium and I was wondering are there any tools similar to ...
0
votes
1answer
37 views

can we create a software application for the full script of selenium coding we have done? [closed]

If we have created some selenium code for web application testing. After completion of the script coding, can we create a java application or something like that?
3
votes
5answers
38k views

Unable to locate element throwing a org.openqa.selenium.NoSuchElementException in TestNG

Am unable to click on element after executing a First test second test showing a org.openqa.selenium.NoSuchElementException . My code Here: public class snapooh { WebDriver driver; @BeforeTest ...
1
vote
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
1answer
400 views

Is use of priority in TestNG a good approach? [closed]

I'm assigning priority to each test method in a specific class under my automation project. My senior reviewed the script I wrote and mentioned to me that do not use priority instead use the xml to ...
1
vote
2answers
1k views

Parallel Testing with Selenium Grid - Static classes have driver issues

I am currently working on an automation project. I have the project itself complete. However, I am now integrating Selenium Grid into my project to run my tests parallel on different browsers e.g (...