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
-1
votes
1answer
6 views

TESTNG, how to validates test case results to pass fail status

Need help, my question here is how can i code it such when the result is not expected testNG will display the test case as failure/fail? if result is expected testcase result is a passed? very new to ...
0
votes
0answers
12 views

i am getting an error “An internal error occurred during: ”Launching sample1“. java.lang.NullPointerException ” [closed]

public class sample1 { @Test public void signup() { System.out.println(" Hi "); } }
0
votes
2answers
197 views

TestNG with Eclipse: How to add main class?

How can I add main class in eclipse cucumber project. I am running cucumber feature file and using TestNG but getting error: "cannot find class in classpath" and as a resolution of this I am geeting ...
2
votes
1answer
709 views

TestNG reports email after test executions

I've found various links for sending TestNG reports to be emailed after test executions here are two of the links https://loganathan1988.wordpress.com/2014/11/03/how-to-email-automated-test-execution-...
0
votes
4answers
2k views

Print all product details in search results using Selenium Java

I am trying to print product details from searched results from this page. This is the function I used for that. @Test(priority = 1) public void printSearchItem() { // print the product details ...
1
vote
0answers
519 views

Unable to run as TestNG in Eclipse Kepler or Luna on Mac machine

I am using Mac Yosemite 10.10.3 and Eclipse Kepler (4.3). I installed latest TestNG from the official site testng.org and added it successfully from Help menu but TestNG option is not showing under ...
1
vote
0answers
721 views

How to keep test cases synced with HP ALM after refactoring?

We're planning to automate test synchronization between HP ALM QC and our TestNG test cases. We want to keep them synced in the following scenarios: Test adding: When creating TestNG test, a test ...
1
vote
0answers
261 views

“NoSuchElementException” while executing Selenium script with TestNG

I'm trying to search a few records on a website. The input data is in an excel sheet and I need to write the search result into another excel sheet. And while executing the script, the screen hangs at ...
19
votes
5answers
68k views

How to handle dynamic changing ID's In XPath?

How to Handle Dynamic Changing IDs In XPath? for example : //div[@id='post-body-3647323225296998740']/div[1]/form[1]/input[1] In this xpath id "3647323225296998740" is changing every time when ...
3
votes
2answers
59 views

What is the difference between BeforeClass and BeforeTest in TestNG - Selenium WebDriver

What is the difference between BeforeClass and BeforeTest in TestNG - Selenium WebDriver, please suggest me best link or site for this.
0
votes
1answer
44 views

org.openqa.selenium.NoSuchElementException

here is my sript driver.findElement(By.xpath("//span[contains(text(),'Hotel Log')]")).click(); Thread.sleep(10000L); driver.findElement(By.xpath("//button[@class='btn cta-button']"))....
0
votes
2answers
167 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
1answer
35 views

In gradle 4.6, how to force all tests in a class gets executed first before moving to tests in next class?

I am using Gradle 4.6 with testng. My test suite has tests organized something like these. java class1 { test 1.1 test 1.2 test 1.3 test 1.4 } java class2 java class3 java class4 java class5 All ...
2
votes
0answers
41 views

BeforeClass doesn't get displayed in TestNG test results window

We are expanding our TestNG suite to run multiple tests. Doing so we've encountered a strange occurrence. In one suite I have two tests. Both tests have one class each. Tests in IntegrationTest.java ...
0
votes
0answers
51 views

While running TestNG program in eclipse getting error: A JNI error has occurred, please check your installation and try again

Getting JNI error while running TestNG program (that doesn't have main() function). But If trying to run the same program with same set of configuration (i.e. eclipse and java version), "Run as a ...
0
votes
1answer
131 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 ...
0
votes
2answers
86 views

Element located when put in a single test case but not located when put in separate test case

I am in a weird situation where I found that my element is located when I wrote in a single test case. But as soon as I put that element in a separate test case, Unable to locate element Exception is ...
0
votes
2answers
15k views

org.testng.TestNGException: Cannot find class in classpath: com.facebook.qa.testcases.LoginPageTest [closed]

[RemoteTestNG] detected TestNG version 6.14.2 org.testng.TestNGException: Cannot find class in classpath: com.facebook.qa.testcases.LoginPageTest at org.testng.xml.XmlClass.loadClass(XmlClass....
0
votes
2answers
40 views

Run appium scripts without using Eclipse or any IDE

I developed appium scripts for my Android app in Eclipse and using this IDE to execute. But I wonder there's any way to run appium scripts on other PC without installing Eclipse or any IDE. I also ...
3
votes
5answers
52k views

Unable to locate element throwing a org.openqa.selenium.NoSuchElementException in TestNG

Am unable to click on element after executing a First test second test showing a org.openqa.selenium.NoSuchElementException . My code Here: public class snapooh { WebDriver driver; @BeforeTest ...
0
votes
1answer
95 views

Automation solution for PDF content validation using Java [closed]

I am doing POC on PDF content validation which will basically validate the content of PDF files. But I didn't find any solutions. Solution which I am looking for: Read the PDF file from a specific ...
2
votes
6answers
37k views

Cannot get a STRING value from a NUMERIC cell. How can I resolve this issue in selenium webdriver using POI?

I am trying to read data from an excel sheet and write on my application.But shows an error while trying to pass a numeric value using string. Please suggest me how can I resolve the issue. Please see ...
0
votes
3answers
435 views

How to run testcases on one browser

I have created some test cases in Eclipse. But while running the testng.xml file it opens in a new browser every time. How do I run it in single browser? I am calling below for each test case, so ...
1
vote
2answers
85 views

How can users run TestNG cases without using an IDE?

I run my test using Java, Selenium and TestNG. When I execute my test suite I have it set up where the testng.xml has all the configurations to run my tests. I am wondering, if I can set up some UI ...
0
votes
2answers
68 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
1answer
49 views

TestNG how to build a queue of test cases to be retried

Currently, we have logic in place which retries all the failing test cases immediately after the failure, what could be any approach where if a test fails that test should go in a queue and should be ...
1
vote
2answers
316 views

Cannot initiate TestNG test

I'm learning to use selenium WebDriver with TestNG plugging for Eclipse and I ran into this issue where I can't execute the test case (it is unfinished but it has no compile errors nor warnings). ...
4
votes
3answers
15k views

Order of execution for Tests in TestNg, If Priority set only for few Test Methods

I have three methods as mentioned below, two with priority ( 0 , 1 ) and third method(Test) with no priority attribute. What is the order of execution. Code snippet given below.. @Test(priority = 1) ...
0
votes
0answers
3k views

TestNG with Selenium Data and Keyword Driven Framework

I am new to TestNG. I'm using Hybrid Framework For Automation Testing, it's Hybrid Architecture based, in which Keyword(Java Methood name) and data is provided in Excel sheet, and based on that ...
1
vote
1answer
170 views

Error in my page

I am using selenium with page factory method to automate a login page. An error came when I try to run my code. My complete code is.. package com.docmgr.Pages; import org.openqa.selenium.WebDriver; ...
0
votes
2answers
478 views

Unable to read the parameter value inside a class using TestNG

To achieve parallel execution, I am updating my existing Junit project to TestNG. The requirement here is to run one scenario in different browsers using TestNG RunnerClass is as follows: import ...
6
votes
5answers
1k views

When and how to do regression testing?

I am learning selenium. I am trying to get into more and more automation. Scenario (example): We are working in agile 2 week sprints. We have a release after every 3 sprints. In our framework we ...
-1
votes
2answers
69 views

Getting java.lang.NullPointerException while trying to instantiate the Webdriver driver under @ Annotation

Please find the code below and let me know why am I getting NullPointer. I am having no clue. package com.seleniumhybridframework.utility; import java.util.concurrent.TimeUnit; import org.openqa....
2
votes
4answers
3k views

How to test using one excel dataprovider in TestNG for multiple test cases

I created a testdata in Excel with multiple test cases. Ex: #UserName# #Password# #PhoneNumber# invalidUsername validPassword validPhoneNumber vaidUsername invalidPassword ...
0
votes
2answers
2k views

Selenium Webdriver TestNG (Java) using While loop for all tests

I am new to Selenium Webdriver Testng and trying to Develop Data Driven framework using CSVReader I have 5 tests in Testng and have to run those all on different environments. So basically I have to ...
1
vote
3answers
110 views

Selenium WebDriver: Should all @Test modules connected to each other?

1. Should all automated test modules connected to each other ? Like, when I have a @Test module for Registration, after executing that module, can I connect this test to @Test Login, @Test Login to @...
0
votes
2answers
63 views

How to add an argument to my BaseTest ChromeDriver Instance?

I have a selenium framework with a BaseTest class. In the BaseTest class we instantiate a ChromeDriver instance which contains various arguments. These are part of the @BeforeMethod (using TestNG). My ...
1
vote
2answers
103 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
vote
1answer
130 views

How to select a dropdown value in Selenium WebDriver using Java appium?

I am new to Selenium, currently am working on selenium webdriver. I want to select a value from the drop-down. But I am not able to do it because of some error. Also, I want to inform you that in my ...
0
votes
0answers
96 views

How to resolve “Cannot find class in classpath: com.AES.Loginpage” error in Selenium?

I have created one java project and written a script for login to application using TestNG class. I got an error: "Cannot find class in classpath: com.AES.Loginpage" I have added jars and driver exe ...
0
votes
2answers
12k views

Selenium IE Webdriver showing “Only Local connection are allowed” in TestNG

I am trying to launch my application in IE browser in selenium using TestNG framework. But, after the IE browser is launched, the Eclipse console shows an error that "Only Local Connection are allowed"...
0
votes
1answer
1k views

Import TestNG results from Jenkins to ALM

I have Jenkins on localhost, configured test project, which is generating passed test: @Test public void aFastTest() { System.out.println("---- ---- ----"); Assert.assertTrue(...
4
votes
1answer
2k views

Dependent methods in the same class run out of order only when included in a “testng suite”; running class independently respects the dependency

I have a class with dependent methods using the TestNG annotation dependsOnMethods The test runs fine 100% of the time if I simply run it as a TestNG Test from the package. When I include the test ...
0
votes
1answer
2k views

Maven TestNG multiple suites in different folders

I'm working on a mobile automation task where I need to run test suites in parallel for 3 different iOS apps. Each test suite has its own testng.xml with a section configured to run on a device. I ...
4
votes
1answer
2k views

TestNG: Multiple suite files are not running but single xml file is running multiple times

This is my testng.xml file: <suite name="Suite1" verbose="1" parallel="true" thread-count="5"> <suite-files> <suite-file path="xml-files/live.xml"></suite-file> ...
1
vote
2answers
876 views

Parameters with DataProviders

Is there any way to use Parameters with DataProvider together in Selenium ? @Parameters({"safaf"}) @DataProvider(name="sss") public void hhhhh (String safaf){ }
0
votes
3answers
571 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
2answers
36 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 ...
1
vote
2answers
115 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
2answers
135 views

Not able to enter case-sensitive credential in android app

I am writing a test case for an android app where the app requires case-sensitive credentials. I writing test cases using appium and TestNG. Steps I am following are - Launching app Entering ...

1
2 3 4 5
7