testng Questions

6

Solved

Can I retrieve currently running test name like in JUnit (using getName() or rules)? @Test public void fooBar(){ System.out.println(magic()); //should print "fooBar" } P.S. I don't want use som...
Apex asked 21/12, 2011 at 21:28

6

I am using Gradle with TestNG. I have this build.gradle: useTestNG() { useDefaultListeners = true suites "src/test/resources/tests1.xml" suites "src/test/resources/tests2.xml" } } How can I ...
Johnjohna asked 25/4, 2017 at 9:40

7

Solved

I'm facing with the following problem: I created two classes which include @Tests with priority attribute: @Test( priority = 1 ) public void testA1() { System.out.println("testA1"); } @Test( pri...
Goldsberry asked 29/10, 2014 at 13:56

5

Solved

The dependsOnMethods attribute of the @Test annotation works fine when the test to be depended upon is in the same class as that of the test that has this annotation. But it does not work if the to...
Patience asked 7/10, 2011 at 19:42

3

Solved

I am trying to use a group to run a subset of tests relevant to what I am working on called "current". The problem is that if I use a superclass to do some setup in a @BeforeMethod, the method runs...
Ormuz asked 16/2, 2011 at 18:1

5

I have @Entity classes in an external package that also have static metamodels. In my application's service class, I am using those metamodels and the EntityManager/CriteriaBuilder/CriteriaQuery to...
Capitalize asked 25/3, 2016 at 18:5

9

Solved

This error NoClassDefFoundError: org/testng/TestNG appears when I'm trying to run my test from Testng.xml file using IntelliJ IDEA. Running my test one by one works perfectly as well as runnin...
Staub asked 22/9, 2016 at 15:43

13

I am using maven project in eclipse ide and added a testng dependency as: <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version&gt...
Manuscript asked 13/7, 2015 at 13:33

25

Solved

I am getting the following error on $ mvn compile: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Sym360: Compilation failure...
Emancipate asked 28/10, 2018 at 18:47

14

In Maven project when I run test case (on Windows): Error running TestApp.readParameter: Command line is too long. In order to reduce its length classpath file can be used. Would you like to enabl...
Rancidity asked 17/6, 2011 at 4:4

2

I am setting up an Spring boot application on Jenkins. For the unit tests i am getting below error. This error is not particular to one test cases. Every time I run it is giving me error for differ...
Taxis asked 19/10, 2018 at 18:31

8

Solved

Howto set the output in test console? When i run test by default the output is replaced by the summary of the test, and System.outs are lost.
Harpp asked 5/12, 2013 at 8:53

3

I am running appium test using testng want to pass app path to desired capabilities as parameter to testng.xml file how can i do this from command line with maven ?
Scalf asked 10/5, 2018 at 6:11

4

Solved

I am currently launching my suit of tests using this XML file: <suite name="something"> <test name="generic valid compilation"> <parameter name="isValid" value="true"/> <pa...
Naturism asked 22/4, 2011 at 1:12

1

I am using Sonar 5.2 to analyze java project, tests written in TestNG. I have test classes with @Test annotation on the class (not on methods). My tests are working fine (testNG treats all public ...
Spiteful asked 10/11, 2015 at 11:5

4

After running Rebuild Project successfully in IntelliJ 13.1.3 Ultimate IDE, I opened my Test NG test file. When right-clicking on the file, I don't see any option to run the test. How can I run a...
Orate asked 8/7, 2014 at 14:19

6

I have an "AllowedValuesValidator.java" class: public class AllowedValuesValidator implements ConstraintValidator<AllowedValues, String> { String[] values; String defaultValue; @Overrid...
Shinto asked 27/2, 2015 at 15:27

6

I have written a test suite using TestNG. I have included only one test.java file for my service. I have created the testng.xml file as well. When I run the testng.xml file, I'm getting below error...
Rolfrolfe asked 5/10, 2015 at 7:42

13

Solved

In the below code i cannot send password keys in the password field, i tried clicking the field, clearing the field and sending the keys. But now working in any of the method. But its working if i ...
Murry asked 19/7, 2017 at 7:32

34

When i'm trying to run the test suite, am getting this exception. We are using maven project here and i am done with refreshing, cleaning, reinstalling testNG and then imported the maven projects b...
Selfsupport asked 28/8, 2014 at 8:11

3

We created some java code (selenium webdriver script) with Eclipse. Inside my project I used selenium jar files and TestNG jar While running these scripts we go test output folder within Eclipse. ...
Viminal asked 19/2, 2015 at 14:33

2

Solved

I'm a bit confused. How can I get TestNG to report an error for a test? // ... @DataProvider(name = "foo") public Object[][] provideData () { throw new SomeRuntimeException("Some error occurred....
Kaz asked 26/5, 2014 at 14:40

9

Solved

I have java 1.6, maven 2, activeMQ 5.5 and functional tests with testng. When I launch it in Idea then OK, but when I try to launch them with maven from console then process suspends after trying t...
Clypeus asked 3/4, 2012 at 2:8

6

Solved

I have solved a topCoder problem for which all the tests pass when I run them on their own. Nonetheless when I run the whole test class some of them fail. Could you, please, help me identify the re...
Serg asked 25/10, 2014 at 10:42

7

Solved

I am using Selenium WebDriver with java. I am fetching all links from webpage and trying to click each link one by one. I am getting below error: error org.openqa.selenium.StaleElementReference...
Andreandrea asked 19/11, 2012 at 5:20

© 2022 - 2024 — McMap. All rights reserved.