Tuesday, February 28, 2017

FindElement Chain - To Find Child Elements

FindElement Chain - To Find Child Elements


You can chain findElement in order to find child elements. Below is a simple example of chaining findElement.

We have 3 radio buttons as can be seen in the image below and their code (using Inspect Element in Firefox). When the below web page is opened, the first radio button is checked by default.


There can be many ways to find elements or child elements. One of the ways is that we can write the code by way of chaining findElement in order to check the second radio button. First findElement is using the Id to find an element and second findElement is using Name.