Debomita Bhattacharjee has Published 863 Articles

How to run selenium (Firefox) web driver without a GUI?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:29:01

2K+ Views

We can run Selenium (Firefox) webdriver without a GUI. This means that the execution has to be kicked in headless mode. The headless execution is popular now since it results in less consumption of resources.Firefox, without GUI, can be executed after we set the geckodriver path. We shall take the help of ... Read More

How to make firefox headless programmatically in Selenium with python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:26:54

1K+ Views

We can make firefox headless programmatically in Selenium. This can be done with the help of the FirefoxOptions class. We shall then create an object option for that class.We shall set the parameter options.headless to True value. This information of the browser has to be passed to the driver object. We have ... Read More

How can I control Chromedriver open window size?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:25:14

3K+ Views

We can control the chromedriver to open with a window size in Selenium. This is done with the help of ChromeOptions class. We have to create an object of that and apply addArguments method on it.Then pass window-size=x, y as a parameter to the method. The x and y are the dimensions ... Read More

How to upload file with selenium (Python)?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:23:02

15K+ Views

We can upload files with Selenium using Python. This can be done with the help of the send_keys method. First, we shall identify the element which does the task of selecting the file path that has to be uploaded.This feature is only applied to elements having the type attribute set to ... Read More

File Upload using Selenium WebDriver and Java Robot Class.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:20:53

8K+ Views

We can upload a file with Java Robot class in Selenium webdriver. It can produce simulationsfor the Keyboard and Mouse Event. It is derived from the AWT package.SyntaxRobot r = new Robot(); r.keyPress(KeyEvent.VK_ENTER); r.keyRelease(KeyEvent.VK_ENTER);ExampleCode Implementationimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import java.awt.*; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; import java.awt.datatransfer.StringSelection; import java.awt.event.KeyEvent; ... Read More

How to start selenium browser with proxy?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:18:44

964 Views

We can start Selenium browser with proxy. The proxy server is an important tool to perform testing on localization. We can take an e-commerce site and verify that the language and currency displayed is as per the location of the user.Using the proxy server within tests, we can test the ... Read More

Disable images in Selenium Google ChromeDriver.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:17:30

1K+ Views

We can disable images in Selenium in chromedriver. The images are sometimes disabled so that page load takes less time and execution is quick. In Chrome, we can do this with the help of the prefs setting.Syntaxprefs.put("profile.managed_default_content_settings.images", 2);Let’s us make an attempt to disable all image from the below page −ExampleCode ... Read More

How to save a canvas as PNG in Selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

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

2K+ Views

We can save a canvas as png in Selenium. We shall first identify the canvas with the help of any locators like xpath, css, and so on. Then obtain the value of src attribute with the getAttribute method.We shall build an URL in java with the class URL and have a BufferedImage via ... Read More

How to get an attribute value from a href link in selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:12:48

14K+ Views

We can get an attribute value from a href link in Selenium. To begin with, we have to first identify the element having an anchor tag with the help of any of the locators like css, id, class, and so on.Next, we shall use the getAttribute method and pass href as a ... Read More

Human-like mouse movements with Selenium.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Dec-2020 13:10:18

3K+ Views

We can do human-like mouse movements with Selenium. This can be done with the help of the Actions class. The human-like mouse movements include right-click, double-click, mouse movement, drag and drop, and so on.To do the mouse movement, the moveToElement method is used. To perform a right-click, the contextClick method is used. Finally, ... Read More

Advertisements