It is projected that in 2020 and forward, challenges in automation testing are growing by leaps. Some of these challenges include picking an appropriate tool, skilled testers, upfront expenses, and time constraints. According to Kumar and Mishra (2016), 30% of QA teams’ effort is utilized in manually writing test cases many times to seek significant returns in the long run. Here it’s very well said that those challenges yield the latest innovative idea - codeless automation testing tools.
Selenium 4 (Alpha) with a new locators called "Relative Locators" earlier it was named "Friendly Locators".
Just to recap, In selenium we have used different types of locators such as ID, Name, CSS Selector, XPath, ClassName, TagName, LinkText and Partial LinkText.
Allure Reporting framework works fine with any test framework like TestNG, JUnit etc. Below example covers the implementation of Allure Reports in Selenium using TestNG, Java and Maven.
Let us first try to understand allure annotations before using them in our selenium example.
@Description("In this cool test we will check cool thing")
These annotations are used in the same way like we use TestNG annotations or JUnit annotations.
In order to run our selenium webdriver automation scripts on chrome/firefox browsers, we have to download the binary/.exe files like Chromedriver.exe and geckodriver.exe.
As we know all know that ExtentReport is an HTML reporting library (open source) which can be integrated with Selenium WebDriver.
In this article, we will teach you how to develop advanced extent reports / integrate Extent Reports with your existing test automation framework.
We assume you have a working knowledge on Selenium,TestNG and Maven.
Let us start now !!!!
Importance of Reporting in a Test Automation Framework :-
Until today, we have used below code snippet in our automation scripts to take the screenshot using selenium. But most of them started complaining about FileUtils which was working fine earlier, but is not working after upgrading selenium webdriver with latest version.
Extent Reports are the most popular reporting used with Selenium. As we all know, TestNG generates html reports by default but they are not more readable and interactive, we have to put lots of efforts to make it attractive. TestNG has provided an ability to implement 'IReporter' an interface to customize testng report by users.
Knowledge which helps to understand the importance of types of locators in Selenium – it’s the first and main step in the way of using such product “at maximum speeds”. And knowledge on their correct usage – it’s the main skill of working with this utility, as the rest knowledge in the process of interface with Selenium is just trivial selecting of necessary libraries and extensions and also using some backdoor ways.
Earlier the way how we used to construct a FirefoxDriver is by passing desired capabilities object like
FirefoxDriver(Capabilities desiredCapabilities) which is now Deprecated. But from Selenium v3.6.0 it is recommended to construct a FirefoxDriver with FirefoxOptions, like below:
ChromeOptions class extends MutableCapabilities. We can use ChromeOptions class to manage options specific to ChromeDriver.
MutableCapabilities was introduced for the first time with Selenium v3.6.0 (Java Client). All the Option classes now extends MutableCapbilities. Refer the JavaDoc link for org.openqa.selenium.MutableCapabilities.