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
0answers
6 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
25 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
26 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
29 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?
-1
votes
0answers
25 views

Getting NullPointerException while usingbApache POI Not able to read data from Excel sheet

SignUpPageTest CLASS : public class SignUpPageTest extends TestBase { TestUtil util; HomePage homePage; SignUpPage signUpPage; String sheetName="SignUp_Data"; public ...
0
votes
1answer
23 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
39 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
30 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
26 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 ...
0
votes
1answer
28 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
44 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
27 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
34 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
51 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
53 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
52 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
108 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
44 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
91 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
33 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
69 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
88 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
46 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
45 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
33 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
23 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
24 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
97 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
45 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
26 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
49 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
60 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
62 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
50 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
57 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
71 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
38 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
52 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
46 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
91 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
357 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 &...
-1
votes
2answers
55 views

How locate dynamic text field element inside dialog box?

I tried to using absolute xpath to locate the dynamic text field element after search but it fails. <div class="pzbtn-rgt" data-click="..."> <div class="pzbtn-mid" data-click="...."> <...
-1
votes
3answers
98 views

Getting Null pointer expections “ java.lang.NullPointerException ”

[RemoteTestNG] detected TestNG version 6.14.3 1553664942228 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "-marionette" "-foreground" "-no-remote" "-...
1
vote
0answers
90 views

How to launch 10 browser instances using Selenium Grid in the same machine

I'm trying to launch 10 browser instances (IE) in a virtual machine and execute same script 10 times parallelly on those browsers. I updated the IE node to have maxInstances=10" -maxSession 10 and ...
0
votes
2answers
145 views

Using TestNG framework : How to call other class of the methods

Using TestNG framework : How to call other class of the methods I have created one class for login and another class for add customer details. My scenario is: Once user login after add customer ...
0
votes
1answer
30 views

the Gecko path is not working

package firsttestngpackage; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.Assert; import org.testng.annotations.*; public class FirstTextNGFile { ...
1
vote
2answers
87 views

TestNG @Test can have a testID?

I'm trying to adapt testrail api. I want to set a integer testID value for a @Test and get the value at iTestListener. In testNG, is there a way to specify a test id for each @Test? I tried ...
0
votes
1answer
38 views

TestNG Listener from one xml file is applied to another

I have two xml files to run tests - api.xml and ui.xml In ui.xml I have TestNG Listener, but this Listener also is applied when API tests run. I run tests using testng.xml ui.xml <!DOCTYPE suite ...
0
votes
1answer
104 views

How to read multiple test data files in same script?

I'm trying to use data in multiple test data files in the same script here. Suppose there are 2 data files with login credentials (Login1.csv and Login2.csv). I need to use credentials in Login1.csv ...