Debomita Bhattacharjee has Published 863 Articles

Clicking an element using javascript vs actions vs webdriver?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 13:24:17

799 Views

We can click on an element using javascript, Actions class and webdriver methods. Selenium can execute commands in Javascript with the help of the execute_script() method.We have to import org.openqa.selenium.JavascriptExecutor in our code to work with a javascript executor. In order to click an element, first we have to move ... Read More

Find and click element by title Python Selenium.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 13:21:15

20K+ Views

We can find and click elements by title in Selenium webdriver. An element can be identified with a title attribute with xpath or css selector. With the xpath, the expression should be //tagname[@title='value']. In css, the expression should be tagname[title='value'].Let us take an html code for an element with a ... Read More

Check if any alert exists using selenium with python.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 13:13:17

4K+ Views

We can check if any alert exists with Selenium webdriver. An alert is designed on a webpage to notify users or to perform some actions on the alert. It is designed with the help of Javascript.An alert can be of three types – prompt, confirmation dialogue box or alert. Selenium ... Read More

How to click the 'Ok' button inside an alert window with a Selenium command?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 13:10:21

5K+ Views

We can click the OK button inside an alert window with Selenium webdriver. An alert is designed on a webpage to notify users or to perform some actions on the alert. It is designed with the help of Javascript.An alert can be of three types – prompt, confirmation dialogue box ... Read More

How to click a link whose href has a certain substring in Selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 13:08:50

2K+ Views

We can click a link whose href has a certain substring in the Selenium webdriver. There are multiple ways to perform this action. We can use find_element_by_partial_link_text() method to click on a link having a substring.The find_element_by_partial_link_text() method is used to identify an element by partially matching with the text within ... Read More

Find next sibling element in Selenium, Python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 13:05:43

13K+ Views

We can find a next sibling element from the same parent in Selenium webdriver. This is achieved with the help of xpath locator. It is important to note that it is only possible to traverse from current sibling to the next sibling with the help of xpath.To traverse to the ... Read More

Click a href button with Selenium and Python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 13:03:57

9K+ Views

We can click a link/button with its href link in Selenium webdriver. This can be achieved by multiple ways. We can use find_element_by_link_text() and find_element_by_partial_link_text() methods to perform this task.The find_element_by_link_text() method is used to identify an element with the text within the anchor tag as specified in the method ... Read More

Using Selenium in Python to click/select a radio button.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 13:00:04

1K+ Views

We can select/click the radio button with Selenium. In an html document, each radio button has an attribute type set to a value as radio. In order to select a radio button, we shall first identify it and then apply the click() method to it.ExampleCode Implementation.from selenium import webdriver driver ... Read More

How to open a new window on a browser using Selenium WebDriver for python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:58:47

8K+ Views

We can open a new window on a browser with Selenium webdriver. There are multiple ways to achieve this. Selenium can execute commands in Javascript with the help of the execute_script() method which is one of the ways of opening a new window. Then we shall use switch_to.window() method to ... Read More

How can I get all element's immediate children with css selectors using selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:57:06

3K+ Views

We can get all element’s immediate children with css selectors. We have to use findElements() method to get immediate children. This method will return a list of elements matching css selector.In a css selector if we need to traverse from parent to child we use > symbol. To get all ... Read More

Advertisements