Debomita Bhattacharjee has Published 863 Articles

Delete Cookies On All Domains using Selenium Webdriver.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 30-Nov-2020 10:46:54

3K+ Views

We can delete cookies on all domains with Selenium. The method deleteAllCookies is used to delete all cookies from the present domain. First, we shall add cookies, then get them and finally delete all the cookies.Syntaxdriver.manage().deleteAllCookies();Exampleimport java.util.Set; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; public class DeleteCookies{    public ... Read More

How to install Selenium in a conda environment?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 30-Nov-2020 10:45:28

973 Views

We can install Selenium in a conda environment. The conda has multiple channels to find packages. We have to search for a package which is compatible with our operating system.All the packages shall be available in the link −https://anaconda.org/search?q=selenium&sort=ndownloads&sort_order=−1&reverse=trueOut of all the packages, the most popular and downloaded one is ... Read More

How to open a link in new tab using Selenium WebDriver?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 30-Nov-2020 10:42:48

10K+ Views

We can open a link in the new tab with Selenium. . The methods Keys.chord and sendKeys can be used for this. The Keys.chord method allows you to pass multiple keys simultaneously.We shall send Keys.CONTROL and Keys.ENTER as arguments to the Keys.chord method. Then the complete string is then passed ... Read More

Browsers and Platforms supported by Selenium Tools.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 30-Nov-2020 10:40:37

441 Views

Selenium is a suite of tools which is used to a large extent by the testing community. It cannot test the desktop application and can only automate web based test cases.Some of the popular browsers supported are −FirefoxChromeIESafariOperaSome of the popular operating systems supported are −Linux/UnixMacWindowsAnother fact, why Selenium is ... Read More

Clear text from textarea with selenium.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 30-Nov-2020 10:39:37

2K+ Views

We can clear text from a text area with Selenium. We shall use the clear method to remove the content from a text area or an edit box. First we shall identify the text area with the help of any locator.A text area is identified with textarea tagname in the ... Read More

Wait for complex page with JavaScript to load using Selenium.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 30-Nov-2020 10:34:40

3K+ Views

We can wait for a complex page with JavaScript to load with Selenium. After the page is loaded, we can invoke the Javascript method document.readyState and wait till complete is returned.SyntaxJavascriptExecutor js = (JavascriptExecutor)driver; js.executeScript("return document.readyState").toString().equals("complete");Next, we can verify if the page is ready for any action, by using the ... Read More

How to install Selenium WebDriver on Mac OS?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 30-Nov-2020 10:32:25

3K+ Views

We can install Selenium on Mac OS. We shall take the help of Homebrew package manager for installation in Mac OS. Let us follow the step by step process −Install Selenium by running the command −pip install seleniumInstall the Chrome driver with the homebrew by running the command −brew cask ... Read More

Capturing JavaScript error in Selenium.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 30-Nov-2020 10:29:16

2K+ Views

We can capture Javascript error in Selenium. This type of error appears at the Console Tab on opening the Developer tools in the browser. This can occur due to some functional issue in the page or due to extra logs which may cause performance issues.We can handle the Javascript errors ... Read More

Switch tabs using Selenium WebDriver with Java.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 30-Nov-2020 10:27:09

14K+ Views

We can switch tabs using Selenium. First we have to open a link in a new tab. The Keys.chord method along with sendKeys is to be used. The Keys.chord method allows you to pass more than one key at once. The group of keys or strings are passed as arguments ... Read More

Capturing browser logs with Selenium WebDriver using Java.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 30-Nov-2020 10:25:01

1K+ Views

We can capture browser logs with Selenium. We have to type cast the RemoteWebDriver to driver and then initialize it. Next, we have to use the setLogLevel method. The import org.openqa.selenium.remote.RemoteWebDriver statement needs to be added in code for the RemoteWebDriver.Syntax((RemoteWebDriver) driver).setLogLevel(Level.INFO);Exampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import ... Read More

Advertisements