testng

Logs from one Test class are displayed in other class's Standard output section in Gradle Test reports

泄露秘密 提交于 2021-02-08 08:53:41
问题 I am using TestNG (with gradle) for parallel test execution. Gradle Task for executing my tests :- task executeTests(type: Test) { useTestNG{ options -> options.parallel = 'classes' options.threadCount = 2 } } I have some logging in tests. In Gradle reports logs of one test class are being printed in standard output section of some other test class when we execute tests in parallel. To debug, I created 3 classes with one test each and printed Thread.currentThread().getId() with logs. In

TestNG - Order of Tests execution in selenium script

寵の児 提交于 2021-02-08 08:22:20
问题 I'm using selenium 3.8.1 and TestNG 6.9.2 version,while test execution before completing the @Test method another @Test method is starts,because of this i'm getting error in selenium script After completion of Test Cases execution. One Class public class LoginPage{ @Test(priority=0) public void test1(){ System.out.println(first test); } @Test(priority=1) public void test2(){ System.out.println(Second test); } } Second Class public class HomePage{ @Test(priority=0) public void test3(){ System

TestNG - Order of Tests execution in selenium script

亡梦爱人 提交于 2021-02-08 08:21:42
问题 I'm using selenium 3.8.1 and TestNG 6.9.2 version,while test execution before completing the @Test method another @Test method is starts,because of this i'm getting error in selenium script After completion of Test Cases execution. One Class public class LoginPage{ @Test(priority=0) public void test1(){ System.out.println(first test); } @Test(priority=1) public void test2(){ System.out.println(Second test); } } Second Class public class HomePage{ @Test(priority=0) public void test3(){ System

TestNG No tests found. Nothing was run

守給你的承諾、 提交于 2021-02-08 04:57:06
问题 I am facing a strange problem with my TestNg code. When I run the testng class without dataprovider my tests run successfully and gets failed which is expected for me. But when I keep my dataprovider in the class for that test. Testng gives an error : [TestNG] No tests found. Nothing was run Below is my code: Please let me know the solution or suggest what I am doing wrong TestNG Version: 6.14.3 package api.tests; import org.testng.annotations.Test; import org.testng.annotations.Test; import

Running different test suites using testng and maven

北城余情 提交于 2021-02-06 13:49:01
问题 I am using TestNg and Maven with the surefire plugin to run my tests. I have several different components that I want to be able to run at different times using the same pom. Currently to do this I have several different XML files defining a test suite and I have the pom set up so i can do mvn test -Dtestfile=/path and use that suite instead. I was wondering if there is a way to combine the XML files into one file and chose base off testnames or some other system? EDIT: I have all my tests

org.testng.TestNGException: An error occurred while instantiating class

倾然丶 夕夏残阳落幕 提交于 2021-01-29 14:59:59
问题 My selenium automation framework using TestNG is working fine on the windows 7 but when I configured the same framework on the windows 10 I'm facing the below issue. Could you please help me on the same. Test Details: Operating system: windows 10 64 bit Eclipse Version: Version: 2019-03 (4.11.0) TestNG version: 6.14.3 [RemoteTestNG] detected TestNG version 6.14.3 org.testng.TestNGException: An error occurred while instantiating class com.saf.aw_nxt_end_to_end_tests.AW_NXT_Login: org/w3c/dom

Java fatJar with resources and dependencies for testNG

[亡魂溺海] 提交于 2021-01-29 05:41:58
问题 I'm trying to build a testng fatjar but looks like this configuration is not adding the resources from java main and tests <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.3</version> <configuration> <argLine>--enable-preview</argLine> <descriptor>src/main/assembly/assembly.xml</descriptor> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <archive> <manifest> <mainClass>Main<

TestNG - no tests were found

亡梦爱人 提交于 2021-01-29 05:18:32
问题 I have a problem with my code. I want to test some elements on a website but after run the tests, TestNG throws the error: "No tests were found". I have already tried to create a new testng.xml but it doesn't work. package tests; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import org.testng

TestNG Parallel Testing, Opens two browsers but runs all tests only in 1 browser

丶灬走出姿态 提交于 2021-01-29 05:11:31
问题 When I run this code, first it opens two Browsers ( Chrome ) and goes to the base URL. But here is the confusing part for me. When the browsers are open, out of these two browsers, only one browser will receive test commands. In my cases, I am running one class and this class has two test cases. but all of the test cases will run in one browser. 2nd browser just open and goes to the bases URL BASE CLASS : package com.cross.base; import io.github.bonigarcia.wdm.WebDriverManager; import org