Posts

Showing posts from July, 2020

Assertion

PURPOSE OF ASSERT IN A TEST AUTOMATION SUITE  Assert plays vital role in automation testing. Without assertion we cannot provide the status of the test cases passed, failed etc. Assertion is used to validate the status of a test case. Let's take an example of a login page where a user logged in through valid username , valid password and clicking the login button. With valid credential it should login to the home page successfully. Now that a user has been logged in successfully there should be some sort of commands which helps to validate the user has successfully logged in. Hence assertion comes into picture, where we can use assertion command to validate whether the user has been successfully logged in by comparing any text in the homepage with the text provided in the command. eg. Assert.assertEquals(expected, actual) Here if the actual and expected matches , then the test case will be marked as a passed.

Explicit Wait, Implicit Wait, Fluent Wait in Selenium using C#

What are Wait commands? Waits are the command in Selenium which is very useful for the execution of the automated test scripts. During execution of automated test script, there might be some situation where issues may occur due to variations in time lag for loading web elements. In these situation Wait commands helps in troubleshooting these issues. Wait commands helps in directing a test script to pause for a certain time before throwing exception. Types of  Wait Commands Selenium WebDriver provides three types of wait commands to implement in tests. 1. Implicit Wait 2. Explicit Wait 3. Fluent Wait Implicit Wait Implicit wait directs the Selenium WebDriver to wait for a certain measure of time before throwing an exception. Once this time is set, WebDriver will wait for the webelement before throwing exception. So by implicitly wait, the WebDriver will wait for certain duration to find any webelement. This can helpful when certain elements on the webpage are not available imme...