Debomita Bhattacharjee has Published 863 Articles

How do I send a DELETE keystroke to a text field using Selenium with Python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 02-Feb-2021 11:39:27

8K+ Views

We can send a DELETE keystroke to a text field using Selenium webdriver with Python. First of all, we have to identify the text field with the help of any locators like xpath, css, id, and so on.We can enter a text in the text field with the send_keys method. ... Read More

Set Chrome's language using Selenium ChromeDriver

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 02-Feb-2021 11:38:58

6K+ Views

We can set Chrome browser language using Selenium webdriver. Some applications are designed such that it can be redesigned to multiple languages without any modifications. This is known as internationalization.In Selenium, we can modify the language preferences with the help of ChromeOptions class for the Chrome browser. We shall create ... Read More

How to fire javascript event in Selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 02-Feb-2021 11:37:50

2K+ Views

We can fire JavaScript events in Selenium webdriver. Selenium can execute JavaScript events with the help of the JavaScript Executor. We shall pass the JavaScript commands as a parameter to the executeScript method.We shall fire the JavaScript event of clicking an element. First of all, we shall identify the element ... Read More

How to send keyboard shortcut ALT SHIFT z (hotkey) with Selenium2?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 02-Feb-2021 11:36:05

2K+ Views

We can send keyboard shortcut ALT SHIFT z(hotkey) with Selenium webdriver. This can be done with the help of the Keys class. We shall use the Keys.chord method and pass Keys.ALT, Keys.SHIFT and z as parameters to that method.The entire value obtained from the Keys.chord method is obtained as a ... Read More

Finding text on page with Selenium 2

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 02-Feb-2021 11:35:54

794 Views

We can find text on page with Selenium webdriver. First of all, we shall identify the element with the help of the locator xpath. In xpath, we can use the contains() and text() functions.Let us find the below highlighted text on the page −The xpath expression shall be //*[contains(text(), 'You ... Read More

Does Selenium support Safari browser?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 02-Feb-2021 11:35:32

939 Views

Yes Selenium webdriver supports Safari browser. Safari is a prominent browser and is provided by default by Apple devices. For Safari versions 10 and greater than 10, the safaridriver comes automatically and is not required to be installed separately.The location of the SafariDriver is: /usr/bin/safaridriver. Also, it must be remembered ... Read More

How to change user agent for Selenium driver?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 01-Feb-2021 12:43:26

13K+ Views

We can change the user Agent for Selenium webdriver. The user Agent header has a particular string that provides the network protocol along with the details of operating system, software version, application, and so on.Selenium does have the ability to get or modify user Agent. This is done with the ... Read More

How to get userAgent information in Selenium Web driver?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 01-Feb-2021 12:42:59

4K+ Views

We can get the user Agent information with Selenium webdriver. This is done with the help of the JavaScript Executor. Selenium executes JavaScript commands with the help of the execute_script method.To obtain the user Agent information, we have to pass the return navigator.userAgent parameter to the execute_script method. Selenium does ... Read More

Set up a real timeout for loading page in Selenium WebDriver?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 01-Feb-2021 12:42:10

4K+ Views

We can set a real timeout for loading pages in Selenium webdriver. There are numerous methods to implement timeouts. They are listed below −setScriptTimeout.pageLoadTimeout.implicitlyWait.The setScriptTimeout is the method to set the time for the webdriver. This is usually applied for an asynchronous test to complete prior throwing an exception. The ... Read More

How to use chrome webdriver in Selenium to download files in Python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 01-Feb-2021 12:41:55

1K+ Views

We can use chrome webdriver in Selenium to download files in Python. We shall use the ChromeOptions class for this purpose. First, we shall create an object of the ChromeOptions class.Then apply the add_experimental_option method on the object created. We shall set the download.default_directory: parameter. Finally, this information shall be passed ... Read More

Advertisements