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.

learn more… | top users | synonyms

1
vote
1answer
317 views

Appium: How to get adb logcat for multiple android devices

I have to execute my test on more then one device. So how to get logcat for every device? My current code is: List logEntries = driver.manage().logs().get("logcat").getAll(); File logFile = new ...
0
votes
0answers
9 views

How to open messaging app during one android app test case is running to fetch otp

How do I open messaging app when test case is running for any other app. Need to fetch OTP from messaging app during a test case is running for my android app. I have tried to create new instance ...
3
votes
3answers
88 views

How To Handle Dynamic Changing IDs In XPath?

Example : //div[@id='post-body-3647323225296998740']/div[1]/form[1]/input[1] In this XPath id "3647323225296998740" Is changing every time when reloading the page. How to handle this type of ...
0
votes
1answer
25 views

Is use of priority in TestNG a good approach?

I'm assigning priority to each test method in a specific class under my automation project. My senior reviewed the script I wrote and mentioned to me that do not use priority instead use the xml to ...
0
votes
1answer
98 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
1answer
35 views

Parallel Testing with Selenium Grid - Static classes have driver issues

I am currently working on an automation project. I have the project itself complete. However, I am now integrating Selenium Grid into my project to run my tests parallel on different browsers e.g ...
0
votes
2answers
50 views

If a test case fails, how to close the browser and move to the next one?

How can i stop the execution of a test case if an exception happen and caught and move to next one. I am using TestNG, Eclipse, Selenium. In my xml, i have: <?xml version="1.0" ...
-1
votes
2answers
99 views

How should look test in webdriver with different Test scenario

I have to test demo.opencart.com. Here is my scenario: Test scenario: 1 Open browser and go to Democart 2 Change currency to GBP (top left dropdown) 3 Search for “iPod” using text search 4 Add ...
0
votes
1answer
49 views

Test Scenario for cookies in selenium webdriver

I want to work with cookies in my project, I don't know what will be the Test Scenario and Test Cases for it. Please help.
1
vote
2answers
4k views

How to run TestNG failed test cases in Jenkins for Maven project?

I am new to Jenkins and I have configured it on my Windows PC. I have to run failed test cases twice before considering that they are failing. I am using TestNG and Selenium Webdriver for writing test ...
0
votes
2answers
3k views

Can I force a Jenkins job to report a successful TestNG test even when the suite has failures?

Can I force a Jenkins job to report a successful TestNG test even when the suite has failures? I have a test suite with 100 tests and I want to report a success in Jenkins if there are 3 or fewer ...
0
votes
2answers
36 views

Cucumber and TestNG integration

I have a simple question as I am just getting into Test Automation. I want to develop Cucumber smoke tests and acceptance tests as they would be easy to read and understand for my colleagues. ...
0
votes
1answer
214 views

How to integrate Jbehave and TestNG?

I googled and found most of scripts were written in Jbehave with junit. But I'm trying to integrate Jbehave with testNG framework. And the following were I tried so far. Feature file: Scenario: ...
0
votes
1answer
64 views

How can I execute selected test cases from list of testcases in TestNG at runtime?

I want to create a page with the details of test cases (say a HTML Page with some content). Say the testcases will be listed there. When i want to run the test cases then I will select them and click ...
0
votes
3answers
129 views

how to run failed testcases using TestNG?

I created jar when i run on command prompt i am able to see result, what i want is "i need to run failed test cases if there is any" public class DemoProjectClass { public static void ...
0
votes
1answer
47 views

How to locate an element which is inside the iframe?

I'm new to automation testing (I'm using TestNG framework and Java language) I'm having trouble in locating an element which is inside iframe. WebElement iframeSwitch= ...
1
vote
2answers
72 views

@Parameters getting Skipped, just basic tests

Here is my testng.xml: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite ...
0
votes
0answers
20 views

Does it require to install all necessary software for slave in jenkins

I have built automation script and everything working perfectly. Now client want to run same script from his location. I am thinking to set his computer as slave in jenkins , but does it require to ...
5
votes
2answers
65 views

What is the difference between jUnit & TestNG?

I want to know difference between Junit & TestNG. Which one is useful for Tester?
1
vote
1answer
63 views

How to launch Safari Driver in Selenium? [duplicate]

I'm trying to launch Safari Driver, but it gives error while launching. Which is the exact procedure to launch Safari? could you please explain? WebDriver driver = new safaridriver() does not ...
0
votes
3answers
534 views

Get Text of a WebElement

I'm learning selenium and writting automation script for this website http://store.demoqa.com/products-page/your-account/ I'm trying to get value of the error message, I identified Error Message ...
0
votes
0answers
16 views

Selenium script is failing from Jenkins

I have selenium framework with TestNG. When i run my script from eclipse it works fine, but when i run the script form Jenkins the build is failing. I am new to Jenkins. Not sure what i am missing. ...
0
votes
0answers
20 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("---- ---- ----"); ...
2
votes
1answer
387 views

Running failed test cases in TestNG

I have a suite which consists of 2 test cases. When I run this suite, the results should be 1 passed and 1 failed. When I am trying to run the failed test cases through TestNG-failed.xml file, it is ...
0
votes
1answer
46 views

How to scroll in html table of webpage?

A web page is showing a table of the first 10 data items out of 150. I want to scroll that table until the element is found. How can I achieve this? I refereed this question ...
0
votes
1answer
36 views

Required parameters but none were supplied error

Can someone help me on how to fix the error and run the script? public class ExcelCapture { public WebDriver driver; String filePath = ...
3
votes
1answer
87 views

Can I execute selenium test cases in a real browser with Jenkins Selenium and Maven

I am working on selenium project with Jenkins + Maven + Selenium + TestNG I am following few questions. Can I execute selenium test cases in Jenkins by launching browsers? Currently it gets ...
0
votes
1answer
120 views

How to Fail Test case based on condition in TestNG Report

I am using TestNG and having one issue. Test Case : I am checking validation message that if user leave email id blank & Click on Login , System should fire message "Please Enter Valid Email". I ...
2
votes
1answer
50 views

Is Parallel Testing possible in Cucumber with TestNG?

I am trying to implement Cucumber-JVM with testNG and I need to execute the scripts in parallel with multiple browsers. Is Parallel Testing possible in Cucumber? If Yes, Can any one help me on this?
0
votes
2answers
48 views

Assert in TestNG (Actual int value, Expected int value)

Is there anyway to assert that, actual int value = expected int value not equal to 0 Something like, Assert.assertEquals(length, 0);
2
votes
0answers
379 views

Selenium Webdriver and OpenLayers

I would like to check that the locations asset on map (openLayer) are the same with some asset in a row. What is the best way to do this? I'm using the TestNG framework.
1
vote
2answers
50 views

What is the difference between Priority and Depends on Method in TestNG?

I am lagging behind to understand the concept of dependsOnMethods and priority. I googled but I didn't get enough info about this. A one line answer will be greatly appreciated. Can we write multiple ...
1
vote
2answers
51 views

Element is currently not visible" random text fields

I am getting this error "Element is currently not visible" when I try to input into textbox which is visible I've created a script to signup and I am getting this error randomly sometimes on ...
1
vote
2answers
66 views

Effective way to deliver automation script to client?

I am QA automation engineer. We have so many clients for whom we are doing web scraping. We automate their daily task to save their time and resource. Every client demands that they should able to ...
0
votes
5answers
403 views

How to revert the changes made by selenium in a tear down process?

I am in a situation where I have to revert all the changes which I made while testing the application. Is there any way of doing this in Testng? Suppose if I have added something into the ...
2
votes
2answers
109 views

How to run multiple Test cases on different browsers in TestNG with Java

I'm new at TestNG. So, I want to know more details about how to run multiple test-cases on different browsers. Which Framework model should I use in my project? So that each & every part of my ...
0
votes
3answers
126 views

How to run multiple test cases without running before and after class again and again

I want to know how run multiple files without running the before class() again and again. E.g.: Consider i am writing test case for GMail login.java : Which contains complete testing of the login ...
2
votes
2answers
3k views

How to verify whether selected item is exist in another page? (Ecommerce application)

I am trying to verify selected item is exists in another (Cart/Shopping Bag) page, for EX: I am buying one/many items from application and then I will move all the items to Cart/Shopping Bag, here I ...
1
vote
1answer
42 views

verify element padding using Galen Framework

I am in process of evaluating Galen as UI automation framework. I am blocked at one point where Galen is unable to give correct results in case of padding around an element. This is the sample DOM. ...
0
votes
2answers
210 views

TestNG.java.lang.NullPointerException running second @Test

It runs first test, but then I'm getting null pointer exception when running Edit Profile test. Not sure why. I globally declared public driver. Please help. Thanks package test; import ...
2
votes
3answers
2k views

Cannot Instantiate class error - Selenium WebDriver

I am facing this 'Cannot insantiate class' error on running one of my test cases in Selenium webdriver using Java. Below is the class of the functionality of the test, package Pages; import ...
2
votes
1answer
93 views

The jenkins build fails when any testng test case fails. How to make it so that the build succeeds when all test-cases are run regardless of result? [closed]

In my Test Automation, when we execute the TestNg Suite XML then whenever any test case fails the Jenkins Build also fails. But I require that the TestNG report shows the proper result, either Pass ...
1
vote
2answers
126 views

Class Under Test vs Object Under Test

What is the difference between Class Under Test (CUT) and Object Under Test (OUT)? CUT is used to test a class and OUT is used to test an object. — I'm unable to find any difference ...
0
votes
2answers
124 views

TestNG showing as test passed even if assertion fails

I use below Java code to check if test fails @Test public void myMethod(){ .. .. Assert.assertEquals(condition1,condition2); }catch(AssertionError e){ e.printStackTrace(); } Even if condition1 and ...
1
vote
2answers
94 views

TestNG + java. Difference between Assert.assertTrue and Assertion?

I'm a little bit confused in testNG assertion methods. My question is simple - is there any difference between Assert.assertTrue and Assertion? I mean difference between following: ...
1
vote
2answers
108 views

Logging every action with custom “debug” method. Good idea?

I'm creating my first full framework using Selenium and TestNG and recently implemented the ability to have logging enabled which will track every action (before and after). public class CustomLogs { ...
0
votes
0answers
20 views

testNG email report display in outlook 2013

I am facing one problem about the testNG report display in outlook. I did some changes to the report displaying format before sent out. Look at the display in outlook 2013 client: Look the display ...
0
votes
1answer
27 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 ...
1
vote
1answer
44 views

Difference between Hamcrest-library jar and Hamcrest-all jar

What is the difference between using the hamcrest-library-1.3.jar that comes bundled with Selenium Webdriver (I use v2.49) and hamcrest-all-1.3.jar found on the official website of Hamcrest ...
3
votes
2answers
69 views

Which test execution framework for Java has the highest test coverage?

I found TestNG failing occasionally and when I started to investigate I found it has little test coverage. It looks like the test framework itself is poorly tested. Which other test execution ...