How to open chrome browser with web security disable in selenium

Let’s see how we can open chrome browser with web security disable in selenium. Below is the running code.

Please share your feedback.

How to iterate elements of a list and click on a specific element in selenium?

Suppose we have a situation where we have a menu which contains 16 elements and you need to click one of them. The most generic solution is to find out the list locator and then iterate it one by one. Let’s see it using an example below.

We are opening www.christianlibraryapp.com website where we have more than 15 options in the Menu. We will iterate it one by one and click on the News menu.

The result will first print all the options available and then click on the NEWS. Please email at online.nimit@gmail.com if you have any questions.

If you like then share it with your friends.

Write Dynamic CSS Selector in Selenium using multiple ways – Part 2

In real project we need more way to find out the locators. We have already discussed the common ways provided at Dynamic CSS Locator Part-1

Let’s start exploring that.

Example

1. Direct Child : Here 3 (div type=opensource), (div class=anotherdivchile) and (div type=licensed) are direct child of div
> symbol is used to identify the direct Child
e.g.

This will found the below 3 direct Child of div

2. Sub Child: It will result in all the div under the parent div.

e.g.

It will result in all the div present

3. Nth-child :

e.g.

3.a.

– Above all 7 li are the direct Child of ul tag. Suppose we want the first li then below css locator will work for that

Locator :

Explanation

3.b. first-child – This is equivalent to

3.c. last-child – This is equivalent to

3.d. – If we say

then it’s looks only for li. It is possible that we have different tag in the list.

3.e.

– If we say

then it’s looks only for li from last. It is possible that we have different tag in the list.

Find Siblings – Use “+” and “~” symbol. + will help to get the next sibling and ~ will give the all next siblings.

Locator :

helps to get the list of all checked box on the page.