Debomita Bhattacharjee has Published 863 Articles

How do I get a parent HTML Tag with Selenium WebDriver using Java?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Sep-2020 11:35:08

672 Views

We can get a parent HTML tag with Selenium webdriver. First of all we need to identify the child element with help of any of the locators like id, class, name, xpath or css. Then we have to identify the parent with the findElement(By.xpath()) method.We can identify the parent from ... Read More

How does Selenium WebDriver's isDisplayed() method work?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Sep-2020 11:14:57

1K+ Views

We can work with isDisplayed() method in Selenium webdriver. This method checks if a webelement is visible on the page. If it is visible, then the method returns a true value, else it returns false.First of all, we have to identify the element with any of the locators like id, ... Read More

How do I get current URL in Selenium Webdriver 2 Python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Sep-2020 11:07:46

997 Views

We can get the current URL of a page with Selenium webdriver. The method current_url is available which obtains the present page URL and then we can print the result in the console.Syntaxs = driver.current_urlLet us find the URL of the page presently navigated and we shall get https://www.tutorialspoint.com/index.htm as ... Read More

How to get all descendants of an element using webdriver?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Sep-2020 09:49:52

2K+ Views

We can get all descendants of an element with Selenium webdriver. First of all we need to identify the parent element with help of any of the locators like id, class, name, xpath or css. Then we have to identify the descendants with the findElements(By.xpath()) method.We can find the descendants ... Read More

Get value of an input box using Selenium (Python)

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Sep-2020 09:41:33

12K+ Views

We can get the value of an input box with Selenium webdriver. The get_attribute() method is capable of obtaining the value we have entered in an input box. To get the value, we have to pass value as a parameter to the method.First of all, we have to identify the ... Read More

How to get attribute of element from Selenium?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Sep-2020 09:36:56

8K+ Views

We can get the attribute of element in Selenium webdriver. The getAttribute() method is used to obtain the value of an attribute in an html document. In an html code, attribute and its value appear as a key value pair.Some of the commonly known html attributes are disabled, alt, id, ... Read More

How to get selected option using Selenium WebDriver with Java?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Sep-2020 09:34:21

17K+ Views

We can get a selected option in a dropdown in Selenium webdriver. The method getFirstSelectedOption() returns the selected option in the dropdown. Once the option is fetched we can apply getText() method to fetch the text.Let us consider the below dropdown Continents get its selected item−Exampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import ... Read More

How to get coordinates or dimensions of element with Selenium Python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Sep-2020 09:30:30

3K+ Views

We can get coordinates or dimensions of elements with Selenium webdriver. Each of the elements have .size and .location properties which give the x, y coordinates and height, width of the element in the form of a dictionary.Syntax −loc = element.locations = element.sizeLet us consider an element for which we ... Read More

How to select an item from a dropdown list using Selenium WebDriver with java?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Sep-2020 09:26:08

2K+ Views

We can select an item from a dropdown list with Selenium webdriver. The Select class in Selenium is used to work with dropdown. In an html document, the dropdown is described with the tag.Let us consider the below html code for tag.For utilizing the methods of Select class ... Read More

Locating child nodes of WebElements in selenium.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Sep-2020 09:22:12

21K+ Views

We can locate child nodes of web elements with Selenium webdriver. First of all we need to identify the parent element with help of any of the locators like id, class, name, xpath or css. Then we have to identify the children with the findElements(By.xpath()) method.We can identify the child ... Read More

Advertisements