Selenium Articles

Page 5 of 37

How to run a TestNG class without using testng.xml with maven?

Ashish Anand
Ashish Anand
Updated on 17-Aug-2023 671 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 Maven provides flexibility to run using surefire plugin. It allows user to run testng.xml as well as directly run a testng class without using a testng.xml. There are few pre−requisites to achieve this: All testng classes should be created under src/test/java. If classes are not created under these directories user should have to pass testng.xml in pom.xml file. By default, maven surefire plugin identifies following classes: "**/Test*.java" − includes all of its subdirectories ...

Read More

How to pass java code a parameter from Maven for testing?

Ashish Anand
Ashish Anand
Updated on 17-Aug-2023 3K+ 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 Maven provides flexibility to run using surefire plugin. Surefire plugin has feature to pass paramaeter from pom.xml to TestNG class or any java code. To achieve this, surefire plugin has another tag named as systemPropertyVariables where user can pass n number of variables and assign the value to these variables at run time using command line. In this article we will illustrate how to pass a parameter from maven to java code. Approach/Algorithm to solve ...

Read More

How to include two group names and create one group to run tests in TestNG?

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

TestNG supports to group the test cases based on similar functionality or uses. However, user may add multiple groups to single test. While running the group using syntax, TestNG runs all tests those are part of the group. It works as OR statement. Like if a test has 2 groups and only 1 is mentioned in tag it will run the test. But, when user wants to run a test only if all the groups are mentioned i.e. AND statement. TestNG doesn’t support directly AND statements in groups. For Example: @Test (groups = {“unit”, “integration”} ) If ...

Read More

How to generate test report in IntelliJ IDE?

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

TestNG allows to run the test suites from IntelliJ IDE as well as command line. When user run the testing.xml either from IDE or command line, TestNG generates a default report. It saves all reports and respective html files in Project −> test−output folder. If folder is not present, TestNG creates the folder. Enable the Report Generation While running the testing.xml from IDE, user has to enable the default reports generation at Add Configuration −> Listeners tab. Following screenshot shows how to enable default report generation in IntelliJ. If user wants to generate report at ...

Read More

Managing Testing Tools for DevOps

Aadyaa Srivastava
Aadyaa Srivastava
Updated on 27-Apr-2023 551 Views

Introduction to DevOps Testing Tools Modern software development and deployment procedures need the use of DevOps testing technologies. DevOps is all about automating and streamlining the development process, and testing is an essential component of that. The use of appropriate testing tools can assist teams in identifying difficulties early in the development cycle, preventing faults from entering production, and eventually delivering high-quality software to clients. Selenium, JMeter, and Postman are some common DevOps testing tools. Selenium is a free and open-source framework for testing web applications, whereas JMeter is a load testing tool for simulating high traffic and measuring ...

Read More

Difference b/w getText() and getAttribute() in Selenium WebDriver

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 28-Jul-2022 10K+ Views

Selenium WebDriver is an automation tool that is used to automate the testing of web applications and make sure they work as expected. Automation means the programmer doesn't have to write testing scripts; Selenium can write test cases without any script.Selenium supports a wide variety of programming languages such as Java, Python, PHP, Ruby, C#, Perl, Scala, etc. which means Selenium can provide test cases in any of these languages. It supports all the popular browsers such as Chrome, Firefox, Safari, and Internet Explorer. Selenium is an open-source tool which makes it even more popular among developers.In this article, we ...

Read More

How to get rid of Firefox logging in Selenium?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 08-Feb-2022 2K+ Views

After the execution of tests, there are logs generated because of Firefox logging in with geckodriver. This log generation by Firefox can be disabled by certain parameters setting.We can stop these logs from being recorded in the console and capture them in a different file. This is achieved with the help of the System.setProperty method. In the above image, we can see the geckodriver logs generated in the console.SyntaxSystem.setProperty(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE, "true"); // turning off logs System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, ""); // record logs in another fileExampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import java.util.concurrent.TimeUnit; public class LogsDisable{    public static void main(String[] ...

Read More

Gmail login fail using Selenium webdriver. Showing element not found for password.

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 18-Nov-2021 862 Views

We can encounter Gmail login failure while using Selenium webdriver due to the error - element not found for password. This can be fixed by the methods listed below −Adding implicit wait - Implicit wait is applied to instruct the webdriver for polling the DOM(Document Object Model) for a specific amount of time while attempting to identify an element that is currently unavailable.The default value of the implicit wait time is 0. Once a wait time is set, it remains applicable throughout the entire life of the webdriver object. If an implicit wait is not set and an element is ...

Read More

How to send a report through email using Selenium Webdriver?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 29-Jun-2021 3K+ Views

We can send a report through email using Selenium webdriver. The email report can be an important feature in an automation framework. An email should be necessarily sent after the combined execution of a regression suite has completed to get an overall view of the test results.The ways to send a report through email are listed below −Using the Java library - Apache Commons available in the below link: https://commons.apache.org/proper/commons-email/.Using the Java mail JAR. The details of this is available in the below link: https://javaee.github.io/javamail/Steps to configure the Java mail JAR are listed below −Step1 − Navigate to the below ...

Read More

How to do UI testing with Selenium?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 29-Jun-2021 2K+ Views

We can do UI testing with Selenium webdriver. To achieve this, we have to follow the steps listed below which can be applied to any script developed to test the UI of the application −Step1 − Object of Webdriver should be created. For example, WebDriver driver = new ChromeDriver();The above piece of code is used to create a webdriver instance and initiate the script execution in the Chrome browser.Step2 − Launch the URL on which we want to perform the UI testing. For example, driver.get("https://www.tutorialspoint.com/about/about_careers.htm");The above piece of code shall launch the URL passed as a parameter to the get ...

Read More
Showing 41–50 of 362 articles
« Prev 1 3 4 5 6 7 37 Next »
Advertisements