Debomita Bhattacharjee has Published 863 Articles

WebDriver click() vs JavaScript click().

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 26-Oct-2020 06:53:23

745 Views

We can click a link with the webdriver click and Javascript click. For the Selenium webdriver click of a link we can use link text and partial link text locator. We can use the methods driver.findElement(By.linkText()) and driver.findElement(By.partialLinkText()) to click.The links in an html code are enclosed in an anchor ... Read More

Refreshing web page by WebDriver when waiting for specific condition.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 26-Oct-2020 06:50:34

953 Views

We can refresh a web page by Selenium webdriver when waiting for a specific condition. We can take the help of the driver.navigate().refresh() method to refresh the webpage.ExampleCode Implementation with refresh().import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class BrowserRefresh{    public static void main(String[] args) {       System.setProperty("webdriver.chrome.driver", "C:\Users\ghs6kor\Desktop\Java\chromedriver.exe");     ... Read More

How to close the whole browser window by keeping the webDriver active?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 26-Oct-2020 06:47:27

807 Views

We can close the whole browser by keeping the webdriver active with the help of Selenium webdriver. To achieve this we have to use the close method. If there are multiple browsers open the close method shall only close the browser which is in focus but the webdriver session still ... Read More

How to get the content of href within some targeted class using selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 26-Oct-2020 06:45:11

887 Views

We can get the content of href within some targeted class with Selenium webdriver. First of all we have to locate the element with an anchor tag having a specific class attribute value with the help of locators like xpath, css or classname.Then we have to take the help of ... Read More

How to scroll a specific DIV using Selenium WebDriver with Java?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 26-Oct-2020 06:43:16

5K+ Views

We can scroll a specific DIV using Selenium webdriver. Selenium cannot handle scrolling directly. It takes the help of the Javascript Executor to do scrolling action to a specific DIV.First of all we have to identify the specific DIV up to which we have to scroll to with the help ... Read More

How to close child browser window in Selenium WebDriver using Java?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 26-Oct-2020 06:40:34

5K+ Views

We can close the child browser window in Selenium webdriver. The getWindowHandles and getWindowHandle methods can be used to handle child windows. The getWindowHandles method is used to store all the opened window handles in the Set data structure.The getWindowHandle method is used to store the browser window currently active. ... Read More

How to set Selenium Python WebDriver default timeout?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 26-Oct-2020 06:38:44

7K+ Views

We can set default timeout with Selenium webdriver. The method set_page_load_timeout is used to have a timeout for the page loading. The wait time in seconds is passed as parameter to the method.Syntaxdriver.set_page_load_timeout(5)A TimeoutException is thrown if the page is still not loaded after the wait time is passed.We can ... Read More

How to use the gecko executable with Selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 26-Oct-2020 06:37:18

320 Views

We can use gecko executable driver with Selenium webdriver. For the Mozilla version above 47, the geckodriver is used due to the presence of Marionette, which is the driver for automation in Mozilla. We can launch the Firefox by instantiating the object of FirefoxDriver class with the help of the ... Read More

How to select specified node within Xpath node sets by index with Selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 26-Oct-2020 06:33:17

7K+ Views

We can select specific nodes within xpath node sets by index with Selenium webdriver. We can mention a specific node with the help of its index number enclosed in [].Let us have a look at the below html code for an element having children. The element with tagname ul has ... Read More

Accessing HTML source code using Python Selenium.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 26-Oct-2020 06:29:21

3K+ Views

We can access HTML source code with Selenium webdriver. We can take the help of the page_source method and print the value obtained from it in the console.Syntaxsrc = driver.page_sourceWe can also access the HTML source code with the help of Javascript commands in Selenium. We shall take the help ... Read More

Advertisements