Posts

Showing posts from August, 2019

Test HTML-WebDriver Wait

Dynamically add Textbox, Radio, Button in html Form using JavaScript Dynamically add element in form. Select the element and hit Add to add it in form. Button Textbox Radio  

WebDriver Exploration Part-2(Locating WebElements)

In this lecture, we will learn how we can locate elements and perform an operation on them. WebElement represents the HTML element with whom we interact during testing. We will now look at how we can find elements and store them in IWebElement Interface Inspecting Element in Chrome browser Open Google home page and right-click on the element with you want to inspect and choose inspect from the popup menu and you can see all the HTML attributes for the element Now we know how can one inspect an element, we will start with locating element and then we will create sample script to interact with an element Locating by ID We will open the google home page and inspect the image above the search text box and you will see that the image is in Div tag with ID as "hplogo". We will create a script to find the div element and then click on the element which will open the search page as per the logo image [ TestMethod ]          public   ...

WebDriver Exploration Part-1(Setting the stage for WebDriver)

In this lecture, we will set up and start exploring  the Webdriver API Let's commence Setting the stage  I have created a new Unit test project called 'WebDriverCourse', which we will be used for WebDriver exploration lectures Right-click on the project -->Manage Nuget packages Click on Browse and search for Selenium.WebDriver and install same. Now you can see the project has reference to WebDriver DLLs under the reference section of the project. Below is the default unitTest.cs file which is autogenerated during project creation namespace   WebDriverCourse {      [ TestClass ]      public   class   UnitTest1      {          [ TestMethod ]          public   void   TestMethod1 ()          {          }  ...

Selenium WebDriver and Automation Framework Introduction

Image
Selenium WebDriver API helps us to automate browser-based applications So why one should go for selenium web driver to automate their web application testing? Selenium is Free Support multiple languages like C#, java etc Huge community easy to use Well that's just good part, can you tell me limitations if any Only works for browser Element identification can be a pain for some applications Sometimes some things will not work the way it is and you need to hack a bit (This is very rare and completely depends on web application one is testing) To know more about selenium web driver refer to the official documentation Automation Framework When we start automating the web application and start adding more and more scripts, we start to realize that we are repeating a lot of stuff and not reusing code, as our motive is to just automate the script. Sooner we fell that all the heavy lifting code which we have in our test cases should be moved to some common compo...

Specflow -Part6(Specflow Hooks)

Image
We may come across a scenario where we need to execute code after/before a particular event like given below We want to create some folder where we can store screenshots/ logfile before starting the test We may want to log details of the scenario in a log file after executing each step  We want to know after each step if that step was successful and if not we want to take a screenshot as an evidence We want to clean up the database before/after each scenario/feature  We  may want to open/close browser for every scenario Hooks help us to execute logic when a certain event occurs, let's check how I will start with creating a new project called SeleniumHooks and added folders where we can keep our feature, feature definitions and hooks file We will add a feature file and implement the steps Feature : SpecFlowFeature1 In order to avoid silly mistakes As a math idiot I want to be told th...