I want to test my api’s use RestAssured with TestNG but i got some error’s.”No tests were [TestNG] No tests found. Nothing was run”. So here is my pom.xml file and testng.xml file. Pom.xml testng.xml testNG Configuration Part of my main class Thank you for your time Answer Ok i remove the psvm and i just use public void instead
Tag: testng
Selenium web driver assert webelement contains text and display actual vs expected
I have a demo selenium cucumber project that just runs some maths expressions in google search box and validates the results. I want the reports to show the actual value vs expected when it fails. I’m storing the returned text as string with .. and then asserting against expected which gets passed from my feature files with … but the
i am getting a java.lang.NullPointerException while executing the testng script
while running the code i am getting this java.lang.NullPointerException in chrome, i have extended the main login class to another and its showing this exception. i have extended the same main class to another diff class and its successfully running but only this class is showing error. here is the code //login page public class admin_login { } //Userclass public
How to locate an element on this page?
I tried a lot to locate elements on this page with this link ALL I want to do is to select “1 queen bed” or “1 double large bed” and then select amount from the drop down list then press, I’ll reserve button. But I totally failed trying all of these:- using Action –> moveToElement –> perform() using JS Execution
TestNG – how to run the same method at the end of each test
I have something like: and I would like to move Assert.assertFalse(errorsExists()) to BaseTestCase or to TestListener so I will not have to pass it every time at the end of the test. I tried to move it to TestsListener to onFinish but method errorsExists() requires driver and I have problems to get it in there. Update: I want to method
TestNG assign programatically DataProvider
If I have a method: Can I create a Listener or something in TestNG, that if I have a method: then it automatically injects specific dataProvider, without explicitly specifying it @Test(dataProvider = “webTarget”) ? Answer Ideally speaking, the easiest way to go about doing this would be to: Define an abstract class in which you define the required data provider
Batch File creation for selenium project
I need to create a .bat file to execute my selenium project that i created with TestNG. I created the .xml file: The problem is i have two @Test and for some reason he executes them as if in the same time since when he tries to login he puts the login values twice. for reference this is my .bat
How TestNG annotation from base class is executed when the Test inside the derived class is executed?
While learning TestNG on Udemy, I come across a code that I am unable to understand. The instructor has created a class named “TestBase” where he defined @BeforeMethod/@aftermethod.Later he created another class named “LoginTest” where he wrote the actual test with @test. He extended TestBase class in loginTest to get variable initiated in TestBase class. When he ran loginTest then
Import automated test results to Xray Cloud multipart using Azure Devops
I am trying to import results to Xray Cloud multipart using Azure Devops, this is my bash command from the yml configuration file: I am receiving this error everytime in the pipeline console: What am I doing wrong? The bash log: Answer If you used the commands exactly as you shared then you must have a file named “pathissueFields.json”. I
How to re run suite without using listener in testng
I had a requirement to re-run a complete suite from the TestNG test method itself if any of the test-case from the suite failed. Is there any way to call complete suite using an XML file or Test class within the Test method? The complete suite should re-run the after-class method or teardown test-case or last test-case @AfterClass or @AfterMethod