Debomita Bhattacharjee has Published 863 Articles

Selenium and Headless Environment.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:07:47

933 Views

We can execute Selenium in a headless environment. The headless execution is a new trend followed in industry today since it is fast and supports more than one browser.Firefox in headless mode, can be run once we configure the geckodriver path. We shall then use the FirefoxOptions class, and send the headless ... Read More

Downloading with chrome headless and selenium.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:05:46

779 Views

We can download Chrome in headless mode in Selenium. The headless execution is one of the ways saving resources by not utilizing the complete graphical interface.After the version 59, Chrome can be used in headless mode. The ChromeOptions class is used to modify the default character of the browser. The parameter ... Read More

Does Selenium support headless browser testing?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:03:36

347 Views

Yes, Selenium supports headless browser testing. This can be done with the help of the HTMLUnitDriver. It is the fastest webdriver among other browser drivers and is platform independent.After Selenium 2.53 version, HTMLUnitDriver jar has to be added explicitly within the project. To add the dependency, follow the steps as ... Read More

Access to file download dialog in Firefox in Selenium.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:00:05

661 Views

We can access file download dialog in Firefox in Selenium. For this we have to first modify the default directory where the downloaded file gets stored. This is done by the addpreference method.p.addPreference("browser.download.folderList", 2);Then, define the new path of the download directory.Finally, we shall ignore the save to disk and open ... Read More

How to set default download directory in selenium Chrome Capabilities?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 12:57:25

4K+ Views

We can set the default download directory in Selenium with Chrome capabilities. All the browsers have a download directory set by default. We can modify it via the browser settings.We can change the setting manually, but it gets modified on triggering a script. We change the directory for download in ... Read More

How can I download a file on a click event using selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 12:54:51

1K+ Views

We can download a file on a click event in Selenium. Normally, on clicking on the download link, a pop-up comes with the file name along with the Open and Save option.To download with a click event, an object of the FirefoxOptions class is to be created. Then with the addPreference method, ... Read More

How do I switch to the active tab in Selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 12:00:36

6K+ Views

We can switch to the active tab in Selenium. The methods Keys.chord and sendKeys are used to open a new tab. More than one key can be passed at once with the Keys.chord method.The Keys.CONTROL and Keys.ENTER combined are passed as parameters to the Keys.chord method. This is stored as a ... Read More

How to download any file and save it to the desired location using Selenium Webdriver?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 11:58:07

3K+ Views

We can download any file and save it to the desired location with Selenium. This can be done by creating an instance of the FirefoxOptions class. Then with the help of the addPreference method, we have to set the browser preferences.We shall also specify the path where the file has to be ... Read More

Checking HTTP Status Code in Selenium.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 11:54:54

2K+ Views

We can check HTTP status code in Selenium. As we run tests, we can verify the status code of a response from a resource. Some of the various HTTP status codes are −5XX – Error in server.4XX – Resource not detected.3XX - Redirected.2XX – Ok.An instance of the class HttpURLConnection is ... Read More

How to open a new tab using Selenium WebDriver?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 11:50:58

1K+ Views

We can open a new tab with Selenium. The Keys.chord and sendKeys methods are used for this. Multiple keys can be passed simultaneously with the Keys.chord method. A group of strings or keys can be passed as parameters to that method.The Keys.CONTROL and Keys.ENTER are passed as parameters to the ... Read More

Advertisements