Debomita Bhattacharjee has Published 863 Articles

How to get content of entire page using Selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:55:05

8K+ Views

We can get the content of the entire page using Selenium. There are more than one ways of achieving it. To get the text of the visible on the page we can use the method findElement(By.tagname()) method to get hold of . Next can then use the getText() method to ... Read More

Get the text from multiple elements with the same class in Selenium for Python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:52:17

6K+ Views

We can get text from multiple elements with the same class in Selenium webdriver. We have to use find_elements_by_xpath(), find_elements_by_class_name() or find_elements_by_css_selector() method which returns a list of all matching elements.Syntax −l=driver.find_elements_by_class_name("gsc-input")Next we shall get the size of the list with len method. We shall iterate through this list and ... Read More

How to type in textbox using Selenium WebDriver with Java?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:50:42

7K+ Views

We can type in a textbox using Selenium webdriver. We shall use the sendKeys() method to type in the edit box. It is an in-built method in Selenium. Let us consider a text box where we shall enter some text.First of all, we would identify the field with one of ... Read More

How do I get the src of an image in Selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:47:08

13K+ Views

We can get the source of an image in Selenium. An image in an html document has tagname. Each image also has an attribute src which contains the source of image in the page.To fetch any attribute in Selenium, we have to use the getAttribute() method. The method takes ... Read More

How to handle frame in Selenium WebDriver using java?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:43:32

1K+ Views

We can handle frames in Selenium webdriver. A frame is identified with tag in the html document. A frame is used to insert an HTML document inside another HTML document.To work with frames, we should first understand switching between frames and identify the frame to which we want to ... Read More

How can I check if some text exist or not in the page using Selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:41:05

18K+ Views

We can check if some text exists or not in a page with Selenium. There are more than one ways to find it. We can use the getPageSource() method to fetch the full page source and then verify if the text exists there. This method returns content in the form ... Read More

How to get text with selenium web driver in python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:37:27

7K+ Views

We can extract text of an element with a selenium webdriver. This is done with the help of a text method. It fetches the text in an element which can be later validated.First we need to identify the element with the help of any locators. Suppose we want to get ... Read More

Getting the URL of the current page using Selenium WebDriver.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:35:45

18K+ Views

We can obtain the URL of the current page with Selenium webdriver. This is achieved with the help of getCurrentUrl() method. It fetches the URL of the opened application. This method accepts no parameters and strings the URL in the form of String.Syntax −String strUrl = driver.getCurrentUrl();ExampleCode Implementation.import org.openqa.selenium.By; import ... Read More

How does selenium webdriver upload files to the browser?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:33:52

1K+ Views

We can upload files to the browser with the help of Selenium webdriver. This is done with the help of sendKeys() method on the element which does the selection of the file by specifying the path of the file to be uploaded.While working on file upload functionality, we need to ... Read More

How to Maximize window in chrome using webDriver (Python)?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Aug-2020 12:30:48

3K+ Views

We can maximize windows on Chrome with a webdriver. While working on any automated test cases, if the browser opens in maximized mode then the probability of the scripts getting failed lessens.This is because if the element is visible, then the chances of its interaction increases. Also, if the window ... Read More

Advertisements