All Questions
Tagged with automated-testing testng
147 questions
0
votes
2
answers
59
views
Seeing NullPointerException on running TestNG Selenium Framework
Written the Test Script in TestNG framework where the Open browser activity is happening in "baseClass" under @BeforeTest annotation and the Test Script is written in Test Packages under as @...
0
votes
1
answer
781
views
TESTNG, how to validates test case results to pass fail status [duplicate]
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 the result is expected test case result is passed?
very new ...
0
votes
1
answer
215
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 ...
0
votes
2
answers
618
views
How to rerun failed test from where they instead of from beginning? (TestNG)
Is there any way to re run the failed testcase from the page where it got failed instead of running the testcase from beginning in Selenium Java ?
0
votes
1
answer
1k
views
Unable to Run Tests on Edge browser in Jenkins
I am trying to run my Tests in the Jenkins using Microsoft Edge.
When I click on build now, I am getting the below error in the Console Output
------------------------------------------------------
...
0
votes
1
answer
45
views
TestNG with multiple datadriven
My code structure logic is this:
I have to fill three sequential forms to add a entry in a list whose data is from Excel. I need each form to have entries from different Excel sheet, i.e first form's ...
0
votes
1
answer
2k
views
Selenium WebDriver "Cannot instantiate class " error is coming
Below is my Base Class:
package com.mercury.qa.base;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import java.util....
0
votes
2
answers
3k
views
Using TestNG framework : How to call other class of the methods
Using TestNG framework : How to call other class of the methods
I have created one class for login and another class for add customer details.
My scenario is:
Once user login after add customer ...
0
votes
1
answer
2k
views
how to run same testcase in 2 different URL in selenium JAVA [closed]
How do I run the same test case in 2 different URL which has same functionality
0
votes
1
answer
2k
views
Can't able to run TestNG its show an error below I mentioned
[RemoteTestNG] detected TestNG version 6.14.2
org.testng.TestNGException:
Cannot instantiate class testing.test
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:30)
...
0
votes
1
answer
260
views
Simplifying Setup of TestNG/Selenium WebDriver Test Classes (using Google Guice?)
I am developing test cases using Selenium and TestNG, and am following the Page Object Model design pattern.
Currently, my page classes look like this (Page1 is just a placeholder, they all have ...
0
votes
2
answers
5k
views
How to pass the web driver instance from one testcase class to another testcase class in TestNG?
InitializeDriver.java:
public class InitializeDriver{
WebDriver driver;
public WebDriver getDriver() throws Exception{
driver = new FirefoxDriver();
System.out.println("Initialize ...
0
votes
1
answer
828
views
How to format TestNG reports in second not millisecond ?
I want convert the milliseconds to seconds in TestNg emailable report.
Please help?
0
votes
3
answers
1k
views
Why my code is not working when I click on the same button for multiple times?
I have same Skip button types kept for 99 products. When I need to click that, it will bring a popup. In the popup I need to click the Cancel button. Each time when I click on the Skip buton it will ...
0
votes
1
answer
38
views
Automated Test Framework for testing Data provided in two files
I would like to develop an automated test framework for testing/verifying the data model of a Desktop application using Java. Basically, the approach I would like go for is to retrieve the data in to ...
0
votes
3
answers
484
views
Cannot set Screenshots on test Listeners - selenium
I am creating TestFramework and want to set in TestListener class the method which take screenshots but during failed test the Browser closes, another browser is opened and the screenshot is created (...
0
votes
2
answers
8k
views
Getting an error after execution as FAILED CONFIGURATION: @BeforeTest Login [closed]
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/...
0
votes
1
answer
819
views
How do I execute multiple test class parallely. which using same function in another class using testng
How can I execute multiple test class 'test1' and 'test2' parallely? Which is using the same function in another class using TestNG.
When I define the parallel option as 'classes' and thread-count as ...
0
votes
1
answer
719
views
Execute TestNG.xml file from Build.xml(ANT)
Below is my Build.xml file. I am trying to execute my TestNG.xml through Build.xml but I am getting the below error every time:
[testng] Cannot find class in classpath:
The below file is working ...
0
votes
3
answers
6k
views
How to run only 1 annotated test method in TestNG ?
I have coded many Test Cases as Test Methods with @Test Annotation.
I have used only one class for all methods.
I want to run only 1 or 2 particular methods. And not run other methods. Please ...
0
votes
2
answers
173
views
Test methods executed which is are mentioned in test suite xml
I have an issue while executing a test suite. Some of the test methods are automatically executed even though they are not specified in test suite. I am using TestNG + WebDriver
Here I have two test ...
0
votes
2
answers
1k
views
Export list of testNG tests within a project/suite?
I have a selenium framework in combination with TestNG.
Is it possible to export a list of all test names are their associated descriptions?
0
votes
1
answer
320
views
How to open and get input from a popup before running test?
I want to open a popup before running my tests and after completing my test run. I want to give few inputs from the popup on basis of that my test will run.
Suppose I have multiple links on which my ...
0
votes
0
answers
362
views
How to verify the Json response field data type in rest assured test
How can we verify the Json data type of mentioned fields such as "price", "ck", "name", "enabled" and "tags" in rest assured test.
{
"odd":...
0
votes
1
answer
7k
views
Cannot invoke "org.openqa.selenium.SearchContext.findElement(org.openqa.selenium.By)" because "this.searchContext" is null error
I am trying to verify a functionality as a guest user and logged in user. In order to do that I log out form the system and verify the guest user actions then login again and verify logged in user ...
0
votes
0
answers
3k
views
Not able to run my test from testng.xml file
I'm not able to run by test case from testng.xml file after run of file I'm getting that Total tests run: 0, Failures: 0, Skips: 0 but if I will try to run the test class directly then test will run.
...
0
votes
0
answers
1k
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
1
answer
6k
views
How to resolve the "java.lang.nullpointerexception null value in entry url=null " in Selenium(POM)
1.TestCommands.java
public class TestCommands {
public void click(By locator,WebDriver driver){
try {
WebElement element = driver.findElement(locator);
element.click(); ...
0
votes
2
answers
1k
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 ...
0
votes
1
answer
261
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
1
answer
5k
views
Getting 'java.lang.NullPointerException' on executing test Cases
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations....
0
votes
1
answer
1k
views
Is there any possibility to open a new tab in existing window in selenium? [duplicate]
I have tried to open new tab in existing browser but it opens in new browser.
0
votes
1
answer
45
views
after click on submit button record will added to the table, so how to verify that record is added or not in the table
There is add employee form, so how to verify the record, should I match the all fields of form which display on table or just match the name, also table is dynamic with pagination.
0
votes
1
answer
129
views
I need to verify a dynamic table record, if they match with data then PASS else Fail the test case using Assert
Page Object Class
public class Transactions {
WebDriver driver;
boolean result1;
public Transactions(WebDriver driver) {
//super();
this.driver = driver;
}
public void ...
0
votes
1
answer
422
views
TestNG + Appium + Java : [TestNGClassFinder] Warning: Can't link and determine methods of class
Question:
How to fix : [TestNGClassFinder] Warning: Can't link and determine methods.
More info:
My Automation is getting failed suddenly. I know it was working well before & even yesterday. Tried ...
0
votes
1
answer
610
views
Dynamic Tests using TestNG selnium arrays
What is the best approach of the follwoing scenario.
I have to run a number of tests which take in dynamic data. The first set of values are pretty standard but then one is dynamic and can be any ...
0
votes
2
answers
4k
views
Can we access the value of a member or class variable of a test class in the testListner methods
I have a situation where 'xyz' is member variable of my testClass and I want to print some information in my report using that variable only.
So I want to access 'xyz' in my 'onTestFailure' listner ...
0
votes
1
answer
1k
views
How to open a link in new tab and then coming back to previous tab in webdriver
I have a situation in which I have to perform some action on one web page and their changes will reflect in the other web page. And after that I want to check whether changes are reflecting or not by ...
-1
votes
1
answer
74
views
How to validate test logic for date dropdown?
I have a close date field where the date is already populated, and a date creation field which is the actual activity creation date and the logic I want to validate is below -
Validate that the ...
-1
votes
2
answers
50
views
Should you test regression tests or just verify/check?
When conducting regression tests, the goal is to find out if the new release affects existing functionalities of the application. Is it enough just to check/verify the application or should one test ...
-1
votes
3
answers
3k
views
How to click on the image inside a grid using selenium webdriver?
I have to click on an image inside a grid. Grid elements have dynamic ID's. Therefore it's impossible to capture elements as usual. How can click on this image?
I have boxed the image I ...
-1
votes
1
answer
82
views
Selenium Webdriver ExtentReports: Putting logStatus after every statement
I have a testcase.java which houses all the @Test methods (login, signup and forget password). Since I'm using Selenium ExtentReports, I put LogStatus.PASS after every single statement has been ...
-1
votes
1
answer
21
views
How can we run multiple Automation projects parallelly in Eclipse IDE?
I have different maven/java projects folder in Eclipse IDE and i usually run those with "Run Configuration". These are Selenium and Cucumber based projects which have a TestRunner.java class ...
-1
votes
3
answers
751
views
Getting Null pointer expections " java.lang.NullPointerException "
[RemoteTestNG] detected TestNG version 6.14.3
1553664942228 mozrunner::runner INFO Running command: "C:\Program
Files\Mozilla Firefox\firefox.exe" "-marionette" "-foreground"
"-no-remote" "-...
-2
votes
1
answer
4k
views
Getting error message while running selenium script
I am facing this problem, please give me a solution
[RemoteTestNG] detected TestNG version 6.14.2
Starting ChromeDriver 2.42.591088 (7b2b2dca23cca0862f674758c9a3933e685c27d5) on port 7027
Only local ...
-2
votes
2
answers
959
views
How to resolve Nullpointer exception [closed]
Here is my code:
General.Java:
package com.hrms.lib;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.openqa....
-2
votes
1
answer
609
views
Page chaining in POM method
I have created three packages.
generic
webpage
script
In generic I have base test and other common methods.
In webpage I created class for each web page.
In Script I have my testcases.
I need ...