If we write tests using TestNG framework perhaps we use the Assert class. But, most of the methods on this class are static, and the constructor is protected. So, in this post, we will explore how to write our own custom assertions to get more handle on the operations.
Selenium WebDriver Tutorial
In this post,we will look at the difference between driver.get() and driver.navigate() methods. Also, we will look at some code snippets to understand well. Both the methods are used to open a webpage in the browser.Each of them loads a new web page in the current browser window. Also, this is done using an HTTP […]
In this post we will discuss SoftAssert. Using SoftAssert when an assertion fails, it doesn’t throw an exception but records the failure. Invoking .assertAll() method, will cause an exception to be thrown if at least one assertion fails. Also,soft assert allows all assertions to run, no matter if they pass/fail. Also, if there are failures, […]
To get started, let’s use this article to demonstrate specifically customized screen shot capture feature in TestNG Automation framework. An awesome capability is to capture screenshot when an Assert fails with TestNG Framework. You can write custom assertions in TestNG by overriding the onAssertFailure() method in the Assert lifecycle. The capability hooks this method to […]
In this post we will go through difference between Implicit Wait and Explicit wait in Selenium WebDriver.In addition , we would go through some code example about both of them. Furthermore, this is frequently asked testing interview question. Also, in some testing interviews you might even be asked to write code snippets.
In this article, we will discuss TestNG custom listener example. First of all, a custom listener can be created, that implements TestNG API ITestListener interface. Also, a custom listener is for listening tests running. Furthermore, we may want to perform some custom actions, after each test is success, failed etc.
BrowserStack is live cloud based browser testing on real desktop and mobile browsers. You can say goodbye to your lab devices and virtual machines if you use BrowserStack.
In this post, we will see how to customize SoftAssert in TestNG Framework. Sometimes, we might write more than one assert in a @Test method and want to make all the asserts run even if one or more fails. This can be achieved using SoftAssert in TestNG ( SoftAssert in TestNG Framework ).
What is @Factory Annotation ? TestNG Factory annotation feature allows us to create tests dynamically at run-time.Factory will execute all the @Test methods in the test class using a separate instance of the test class.
TestNG DataProvider Basic Example. What is DataProvider ? @DataProvider allows a @Test method which uses the data provider to be executed multiple times. By using DataProvider the @Test method would be executed using the same instance of the test class to which the test method belongs.