Selenium Articles

Page 4 of 37

How to Download the Latest TestNG Jar File?

Ashish Anand
Ashish Anand
Updated on 21-Aug-2023 4K+ Views

TestNG is an open−source automation testing framework. It can be used along with build tool such as maven, Gradle, ant and even with snapshot. However, user can separately download the TestNG jar file and configure it with the project without using build tool. In this article, we will see how to download latest TestNG jar. Download latest TestNG jar Following steps should be followed to download the latest/specific version of TestNG jar. Open the browser and navigate to https://testng.org. Once page opens, click on Download present at top. Following screenshot displays testing.org page and download button. ...

Read More

Why to use Selenium with TestNG?

Ashish Anand
Ashish Anand
Updated on 21-Aug-2023 428 Views

TestNG is a powerful testing framework, an enhanced version of JUnit which was in use for a long time before TestNG came into existence. NG stands for 'Next Generation'. TestNG framework provides the following features − Annotations help us organize the tests easily. Flexible test configuration. Multiple test cases can be grouped more easily. Parallelization of tests can be achieved using TestNG. Support for data− driven testing. Inbuilt reporting as well as supported by Extent Reporting and other reporting tools. Selenium by default doesn’t generate any report. Easily configured for Cross Browser testing. TestNG framework can easily integrate ...

Read More

Why does TestNG Allow Several Expected Exceptions?

Ashish Anand
Ashish Anand
Updated on 21-Aug-2023 410 Views

TestNG supports multiple exceptions in single @Test method. It is similar to the catch exception in Java where user can mention multiple exception class those are possible to be thrown. Ex: Syntax in catch exception is: catch(IOException | InterruptedException ex) { Similarly, syntax in TestNG is: @Test(expectedExceptions={NullPointerException.class, IllegalArgumentException.class }) public void throwsNullPointer() { throw new NullPointerException(); } One point to note that, in such scenarios, TestNG expects the one of the exceptions must be thrown from the list. If exception is different from the list or no exception, in such cases it fails the method. ...

Read More

How to do Cross Browsing Testing in Selenium with TestNG?

Ashish Anand
Ashish Anand
Updated on 21-Aug-2023 259 Views

TestNG is a powerful testing framework, an enhanced version of JUnit which was in use for a long time before TestNG came into existence. NG stands for 'Next Generation'. A website should be tested across multiple browsers like IE, Chrome, Firefox, Safari to validate the compatibility of website and functionality. Since the HTML, CSS and java scripts are unique across all browsers, it is always recommended to do cross browser testing to ensure the compatibility of website. Selenium supports cross browser testing so does the TestNG. In this article, we will analyze how to perform cross browser testing in Selenium ...

Read More

How to get the current status of test methods in TestNG?

Ashish Anand
Ashish Anand
Updated on 17-Aug-2023 496 Views

TestNG supports native dependency injection. It allows to declare additional parameters in methods. At the run time, TestNG automatically fill these parameters with right value. Following are few native dependencies in TestNG: ITestContext XmlTest Method ITestResult These dependencies help to retrieve the test execution status. Usually, @AfterMethod supports all these native dependencies and test status could be either Success, failure or Skip. However, TestNG supports following test status those can be retrieved by calling the function at right place.                               ...

Read More

How to update IntelliJ Idea testng-plugin to testNG version 6.8 or latest version?

Ashish Anand
Ashish Anand
Updated on 17-Aug-2023 801 Views

TestNG is an open−source automation testing framework. It can be used along with build tool such as maven, Gradle, ant and even with snapshot. However, user can separately download the TestNG jar file and configure it with the project without using build tool. In this tutorial, we will see how to update IntelliJ IDEA testing−plugin to TestNG version 6.8 or latest TestNG jar. Download latest TestNG jar Following steps should be followed to download the latest/specific version of TestNG jar. Open the browser and navigate to https://testng.org. Once page opens, click on Download present at top. The ...

Read More

How to set TestNG in classpath in Maven project?

Ashish Anand
Ashish Anand
Updated on 17-Aug-2023 555 Views

Maven is a project management and comprehension tool that provides a complete build lifecycle framework. User can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle. In case of multiple environments, Maven can set−up the way to work as per standards in a very short time. As most of the project setups are simple and reusable, Maven makes life easy while creating reports, checks, build and testing automation setups. Maven provides developers ways to manage the following − Builds Documentation Reporting Dependencies SCMs Releases Distribution Mailing list ...

Read More

How to separate unit and integration tests in TestNG + Maven using Annotations?

Ashish Anand
Ashish Anand
Updated on 17-Aug-2023 322 Views

TestNG is a testing framework and can use Maven as build tool. It helps to maintain dependencies and their version at one place in pom.xml User can run test from testng.xml or pom.xml. To run tests from pom.xml, user need to mention the path of testng.xml and require maven−surefire−plugin to execute. Along with testng.xml, maven provides feature to run specific group through maven or command line. While running through command line, user can mention group name at run time without changing anything either in testng.xml or pom.xml. This feature can be utilized to separate unit and integration tests. User can ...

Read More

How to run single test in a TestNG class from IntelliJ IDE?

Ashish Anand
Ashish Anand
Updated on 17-Aug-2023 670 Views

TestNG allows to run the test suites from IntelliJ IDE as well as command line. Usually, IntelliJ IDE is handy to run testng.xml for development purpose while command line (cmd) for actual execution. Apart from this, IntelliJ supports to run only single TestNG class as well as single test method inside a class. This feature helps while writing the code and debug it. In this article we will discuss how to run a single testng class as well as single test method inside a testng class. Approach/Algorithm to solve this problem Step 1: Create a TestNG class &minus ...

Read More

How to run Junit test in Maven?

Ashish Anand
Ashish Anand
Updated on 17-Aug-2023 2K+ Views

Maven is a project management and comprehension tool that provides a complete build lifecycle framework. User can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle. To summarize, Maven simplifies and standardizes the project build process. It handles compilation, distribution, documentation, team collaboration and other tasks seamlessly. Maven increases reusability and takes care of most of the build related tasks. Junit is a testing framework and can use Maven as build tool. It helps to maintain dependencies and their version at one place in pom.xml User can run ...

Read More
Showing 31–40 of 362 articles
« Prev 1 2 3 4 5 6 37 Next »
Advertisements