Questions tagged [testng-annotation-test]

Test Annotations: The @Test annotation marks a class or a method as part of the test.

@Test Annotation: The @Test annotation marks a class or a method as part of the test.

Documentation: TestNG

75 questions
0
votes
1 answer

Can we set priority at Class level in TestNg?

@Test(priority=2) public class PositiveTests { public void loginTest() { } @Test(priority=1) public class NegativeTests { public void negativeLoginTest() { } TestNg.xml
0
votes
1 answer

Getting cross mark on pom.xml in selenium and org.testng.TestNGException

Getting cross mark on pom.xml and while running testrunner code I am getting this error. org.testng.TestNGException: Cannot find class `enter code here`in classpath: testrunner.TestRunner at org.testng.xml.XmlClass.loadClass(XmlClass.java:81) …
0
votes
1 answer

How to execute test cases from multiple classes with priority using Testng in Selenium

I have following requirement I have 3 different classes Class A Class B Class C in all three classes there are multiple test cases which runs on 3 different URLs Class A TC1 Class B TC2 TC4 Class C TC3 I want to run the TCs in following…
Sumit Soni
  • 29
  • 2
  • 6
0
votes
1 answer

How to find locator xpath/cssselector for a tag inside the span tag?

This is the HTML Code[enter image description here][2] I tried the below one. It's working. But am converting to TestNG the code will throw errors. WebElement userActions = driver.findElement(By.xpath("//div[@class='row col-md-12…
0
votes
1 answer

The Annotations @Parameters is disallowed for this location

I have tried to pass the parametersto test methods. test.xml file look like this
Sai sai
  • 1
  • 1
0
votes
1 answer

Exception in thread "main" java.lang.NoClassDefFoundError"

Facing 'Exception in thread "main" java.lang.NoClassDefFoundError"' exception in intellij import org.testng.annotations.Test; public class FistTestCase { @Test void setup() { System.out.println("Open browser"); } …
0
votes
1 answer

TestNg @Dataprovider is not working in my DataDriven testing - using selenium eclipse

My Java class is not running. I have a @DataProvider with Apache POI to read data from an Excel file and set that values in an web page. but the script is ending with No test found error. Here is my code : package testCases; import…
0
votes
2 answers

Java TestNG :: How are Arguments Suppled to my Test Method?

I'm struggling to understand the flow of execution of some Java TestNG code that my boss assigned to me. Unfortunately, the original author is no longer with my company, so I'm on my own. I've read through a few TestNG tutorials (especially this…
Pete
  • 1,511
  • 2
  • 26
  • 49
0
votes
0 answers

TestNG not executing all tests

I have created the following method to execute the methods given a list of .class: public static void executeTestNew(String testName, List> test) { try { List parsedTests =…
0
votes
1 answer

When a @BeforeTest method fails, why is it not being listed in the testng-failed.xml?

I am using maven with testng 6.14.3. Here is my code structure: testng.xml
AutoTester999
  • 528
  • 1
  • 6
  • 25
0
votes
0 answers

I have a error while running my TestNG in Eclipse IDE , Can anyone have a look

This is the Code: package myrestassuredpractise; import java.util.concurrent.TimeUnit; import org.junit.Assert; import org.testng.annotations.Test; import io.restassured.RestAssured; import io.restassured.response.Response; public class…
0
votes
1 answer

Getting NegativeArrayExcetion while reading excel file in selenium

Getting error java.lang.NegativeArraySizeException: -1 as I read the data from Excel in selenium. I used TestNG framework. I used @DataProvider annotation for providing data from excel. package testCases; import…
0
votes
1 answer

TestNG Dataprovider priority

I have a TestNG Dataprovider tests like below: Input.csv id,priority,testData,... T1,1,someData,... T1,0,someData,... Reader @DataProvider(name="abc") public Object[][] readData(){ // Logic to read csv…
0
votes
1 answer

How to put a method i @beforeTest

A selenium/java rookie here. :) Trying to understand everything about Test annotations and how to use an method (is it called that) in all classes. I have this class below where i have a metod called in each @Test, but i would like to put as mush as…
Fredrik
  • 7
  • 4
0
votes
0 answers

Running WinAppDriver programmatically in TestNG and POM automation framework

Background: I have an automation framework setup for Windows Applications using WinAppDriver, TestNG and POM. As we know, for WinAppDriver we need to run the server manually before running the tests on- http://127.0.0.1:4723/. I am trying to run…