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
14
votes
5answers
52k 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 ...
7
votes
3answers
2k views

Page Object Model or External property file for Selenium Object Repository

I am a beginner in Selenium WebDriver (Java with TestNg). I'm trying to create a framework of my own. My question here is what would be the better option to store my objects (basically all the ...
5
votes
2answers
7k views

Difference between Selenium and TestNG

Am a beginner in Selenium and am trying to learn selenium on my own by googling. One thing which I noticed was in many of the posts which I read about selenium the name of the framework by name "...
2
votes
2answers
2k 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 { ...
2
votes
2answers
776 views

How to automatically rerun failed TestNG tests on Jenkins and update the final results to pass if retries passes?

How to automatically rerun failed TestNG tests on Jenkins and update the final results to pass if retries passes? Description: I have two tests that ran. Test1 passed, but Test2 failed then on retry ...
2
votes
3answers
2k 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 ...
1
vote
2answers
2k 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 ...
1
vote
1answer
49 views

Can I create an executable TestNG Selenium jar with my tests using maven

##### My POM file pom.xml http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 company.myproj myproj 0.0.1 jar <properties> <project.build.sourceEncoding>UTF-8</project....
4
votes
2answers
12k views

How and where to store dynamic result/data using webdriver java

I want to know "How and where to store dynamic (Search results) result/data", I am getting the results and not sure what to do next. Also, after saving these results I want to use this in another ...
3
votes
3answers
386 views

How to implement a lock in Selenium with Java?

I want the Script to Openfile.exe only if the previous one i.e CreateNew.exe has finished executing. Right Now whats happening is, when I run TestNG.xml file it runs all the @Test priority wise and ...
1
vote
1answer
1k views

Rerun failed tests with TestNG

I recently migrate from Junit to TestNg. Currently, I try to understand how to rerun the failed test. According, I've just to run my test suite then recall TestNG with the testng-failed file. Easy. ...
1
vote
4answers
22k 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 ...
1
vote
1answer
401 views

How to control TestNG to iterate all Tests in each iteration instead of iterating individual tests before moving on to the subsequent test

Problem - I have 6 tests and one dataprovider with 2*2 object array. I want TestNG to pick first data, use it in First test and then subsequent tests are executed based on the data picked in first ...
1
vote
1answer
156 views

Where to initialize TestNG TestContext

I have a TestRunner class that starts my TestNG like this: TestRunConfigs configs = TestRunConfigs.parseCommandLine(args); TestNG testRunner=new TestNG(); testRunner.setXmlSuites(getXmlSuites(...
-2
votes
1answer
66 views

How to assert that particular element is not displayed? [duplicate]

Can someone help me fixing NoSuchElementException. Let me explain what I am trying to do. I am trying to login into an application with multiple sets of data. Lets say, 1) Valid username and ...