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
2answers
31 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
14 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
67 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
73 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
14 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
79 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
41 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
22 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
vote
2answers
79 views

Cannot initiate TestNG test

I'm learning to use selenium WebDriver with TestNG plugging for Eclipse and I ran into this issue where I can't execute the test case (it is unfinished but it has no compile errors nor warnings). ...
0
votes
0answers
12 views

PackageRelationshipCollection issue in selenium

Exception in thread "main" java.lang.IllegalAccessError: tried to access method org.apache.poi.util.POILogger.log(ILjava/lang/Object;)V from class org.apache.poi.openxml4j.opc....
-1
votes
1answer
50 views

Extent reports issue in maven project

I am using extent reports in my project but it is showing me error and I am not getting solution for this error: [RemoteTestNG] detected TestNG version 6.14.3 Starting ChromeDriver 75.0.3770.140 (...
0
votes
1answer
40 views

Unable to Run Tests on Edge browser in Jenkins

I am trying to run my Tests in the Jenkins using Microsoft Edge. When I click on build now, I am getting the below error in the Console Output ------------------------------------------------------ ...
-1
votes
1answer
31 views

Can I use this library for Junit?

I put this library: import org.apache.commons.io.FileUtils; but it sends an error The import org.apache.commons.io cannot be resolved what library is equivalent exist for Junit?
0
votes
1answer
33 views

gitignore of Selenium WebDriver TestNG

For selenium webdriver testng using git, what should be part of gitignore so my scripts can run on any computer without any conflict. Thanks!
-1
votes
1answer
42 views

How to validate test logic for date dropdown?

I have a close date field where the date is already populated, and a date creation field which is the actual activity creation date and the logic I want to validate is below - Validate that the ...
0
votes
1answer
32 views

Using priority in test cases with retry listener

I have test cases which have priority tags on them. Let's say 30 cases run sequentially one by one. But this does not allow me to attach a retry listener to my cases due to tests being dependent on ...
0
votes
2answers
30 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 ...
1
vote
1answer
34 views

run tests in a sequence given a dataProvider object

I'm implementing selenium tests. In the scenario, there are same tests in different pages. So I tried to use 'DataProvider'. It works, but I think there could be a better way. I need to run 'mostView'...
-1
votes
1answer
45 views

What should be Assert for below code, tried for assertTrue,assertFalse,assertNull and assertNotNull

I have written below code to verify web table data headers and value of rows and columns but when I am adding different assertion for it, its not working and throwing compilation error. Can any one ...
0
votes
1answer
29 views

Compilation error when iterating through While loop, compilation error at line no. 10, start of While loop

I am getting compilation error when trying to store list size value into an int. public class HandleWebTable { private static WebDriver driver; public HandleWebTable(){ super(); } public ...
-1
votes
1answer
71 views

How to assert links count on web page through selenium webdriver

I have written below code in a separate class to count links on a particular webpage, How to assert this in a test case class: public static void navigateToLinkInHomePage() throws Exception { ...
1
vote
1answer
73 views

Is there a way to disable the logs created by the pagefactory

Could someone please let me know if there is any way we can disable the logs generated by the page factory for Chrome and Firefox I did try the below options for chrome and firefox and I had also ...
0
votes
1answer
38 views

Unable to install the TestNG plugin in eclipse

Getting below error while installing TestNG: Can someone help me on this?
0
votes
1answer
60 views

How to handle multiple tests in same webdriver instance without closing and opening browser again?

Below is my testscript, have called other class methods to it. I would like to divide the testcases to different tests. Now running all in one that would increase my count again more. @Listeners(...
0
votes
1answer
63 views

How to write meaningful test case title in TestNG+Selenium

When writing manual test cases, the test case title used to be something like TC1: Verify that the user is able to login to facebook and react using heart. When trying to automate the scenario ...
0
votes
6answers
120 views

Is using “Selenium & Test NG” the best approach to Automate Regression Test Cases for Web based Application? [closed]

We have a requirement to automate Test Cases for a Web based application. We have to use only open source tools. Total Test Cases would be around 600-700.
0
votes
1answer
54 views

Null PointerException on TESTNG ,pagefactory

LoginPage.Java package TestCases; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.PageFactory; import org.testng.annotations.Test; import ObjectRepository....
0
votes
3answers
184 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
0answers
80 views

Using maven to create a standalone jar file that executes in any OS

I am trying to create a standalone selenium-TestNG tests Jar file that can be executed in any OS as part of CI/CD. My POM.xml is as follows: <project xmlns="http://maven.apache.org/POM/4.0.0" ...
0
votes
2answers
72 views

assertequals() returns true but make my test case failed

I have added assertion(Assert.assertEquals(condition,"expected","message")), it returns true then also it gives an error and make my testcase failed, with Assertion error and message? Can any one help ...
1
vote
1answer
383 views

Can I create an executable TestNG Selenium jar with my tests using maven

##### My POM file pom.xml http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 company.myproj myproj 0.0.1 jar <properties> <project.build.sourceEncoding>UTF-8</project....
0
votes
2answers
50 views

I have added Assertion in my tc and make the login tc failed but I am not getting any output on console provided in assertion

I have added Assertion(Assert.asserttrue(true,"login failed")) in my every tc and conditions are according to that but when login tc failed I am not getting any output on console provided in ...
0
votes
1answer
47 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 ...
-1
votes
2answers
34 views

Should you test regression tests or just verify/check?

When conducting regression tests, the goal is to find out if the new release affects existing functionalities of the application. Is it enough just to check/verify the application or should one test ...
0
votes
1answer
34 views

TestNG with multiple datadriven

My code structure logic is this: I have to fill three sequential forms to add a entry in a list whose data is from Excel. I need each form to have entries from different Excel sheet, i.e first form's ...
0
votes
0answers
49 views

Extent Report : [TestNG] Reporter x.x.ExtentReportListener.ExtentReport@afc191 failed java.lang.NullPointerException

Getting nullPointer exception in extent report . Help me on this issue unable to trace the root cause Using extent report 2.41.0 Here is the my log: [TestNG] Reporter com.psiexams.base....
0
votes
1answer
166 views

Selenium WebDriver “Cannot instantiate class ” error is coming

Below is my Base Class: package com.mercury.qa.base; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; import java.util....
0
votes
2answers
54 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
2answers
31 views

How to use assertion to compare both different size of the rows?

I want both size of the rows shouldn't be matched. int firstnum = 0; List<WebElement> preRoutlList = driver.findElements(By.xpath("//*[@id='txBottomTable']/table/tbody/tr")); ...
2
votes
1answer
63 views

Unable to pass dynamic xpath in repository file?

My code is : for (int z = 0; z < rows.size(); z++) { rows.get(z).findElement(By.xpath("//*[@class='ng-scope'][" + (z + 1) + "]//*[@placeholder='Stop Name']")).sendKeys(shuttleObj.getStopArea()); ...
0
votes
2answers
73 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 ...
1
vote
2answers
104 views

Chrome Driver - testNG parallel issue

I am trying to run selenium test classes parallel using testNG like this thread-count="3" parallel="classes" . But the issue is at closing the chrome driver and everything else works fine. while ...
0
votes
1answer
53 views

Unable to find the correct xpath for input field?

Unable to locate the element. <div class="col-md-4"> <label class="radio-inline"> <input type="radio" name="routing_option" data-ng-model="generateRoutes" data-ng-value="'...
0
votes
1answer
75 views

Getting 'java.lang.NullPointerException' on executing test Cases

import org.openqa.selenium.WebDriver; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations....
-2
votes
1answer
80 views

How to assert that particular element is not displayed? [duplicate]

Can someone help me fixing NoSuchElementException. Let me explain what I am trying to do. I am trying to login into an application with multiple sets of data. Lets say, 1) Valid username and ...
0
votes
1answer
41 views

Getting error message on webpage but test cases get passed -using testng with selenium

Driver class: package com.deere.gmsr; import java.util.Properties; import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; ...
-1
votes
1answer
66 views

Getting “java.lang.NullPointerException” exception when i try to run my POM test [duplicate]

I have 2 classes in my project First class contains all the webelements Second one for method where i am using this elements package facebook; import org.openqa.selenium.By; import org.openqa....
-1
votes
2answers
48 views

What is the best implementation strategy of Driver creation in Selenium Webdriver with Java?

As in my framework, I am creating the driver object by collecting the info from the test suite itself. We are passing the driver name through the testng suite and at runtime, we are collecting the ...
0
votes
1answer
177 views

Is there any possibility to open a new tab in existing window in selenium? [duplicate]

I have tried to open new tab in existing browser but it opens in new browser.
0
votes
0answers
617 views

Cucumber and TestNG, how to pass parameter?

Could you please tell, how to pass parameter in Cucumber using TestNG? I have following code, but it does not work. Error in stepDefinition.java on the line @Parameters({"environment"}) testng.xml &...