Element location using XPath Axis

During testing we will sometimes come up to situations where developers are not following best practises for testability . We will frequently come up situations where elements doesn’t have any unique identifiable property. XPath axis comes to help in those situations. We can identify elements using various XPath Properties List of various XPath Axis are available in https://developer.mozilla.org/en-US/docs/Web/XPath/Axes If you have well-defined properties to identify the element, use them as your locator. Please read locator strategy Using XPath and Other Parameters ...

September 3, 2016 · Aby George A

Element Location using XPath

XPath is XML query language which can be used for selecting nodes in XML. Hence it can be used to identify elements from DOM since they are represented as XHTML documents. Selenium WebDriver also supports XPath for locating elements. They also help to look for elements in both direction and hence it is generally slow compared to all other locator strategy. We can use XPath with both absolute path and relative path. ...

August 30, 2016 · Aby George A

Identifying elements using Locators in Selenium

Locators are html properties of a web element , which can be considered as an address of the element. An element will have various html properties. We can use Firebug extension or Chrome dev tools to identify different locators of an element. Selenium Web Driver provides two different methods for identifying html elements . _**FindElement **_for WebDriver and WebElement Class. When locating element matching specified criteria, it looks through DOM( Document Object Model) for matching element and return the first matching element. If there are no matching element, it will throw NoSuchElementFoundException ...

August 17, 2016 · Aby George A

Specflow - Sharing data between steps

In Specflow, Step definitions are global. So a scenario can have multiple step definitions which can be present in different classes. Sometimes, there arise a need to share the data between steps residing in different classes. How do we do it?? There are multiple ways to do it Context Injection Feature Context Scenario Context Let us look into more details about how to store and retrieve data using Scenario Context . ...

August 1, 2016 · Aby George A

Data Driven Framework - XML

I am not going to explain what is data driven framework or what is its benefits. All of them are pretty well-known . If not, just google it. Here I am going to explain a sample code which can be used to read from xml data files. This will be helpful to implement a data driven frame work for BDD testing , using Specflow or Cucumber Pre - requiste Code is written in Csharp . We need to add below reference to visual studio solution ...

July 29, 2016 · Aby George A