Selenium WebDriver Tutorial #16 – WebElement Methods in Selenium

In this Selenium Webdriver Tutorial we will learn about Webelement methods in Selenium Webdriver. You will learn about some of the key webelement commands/methods in Selenium Java along with examples.

Some of the key methods covered are:

✅ sendKeys(java.lang.CharSequence… keysToSend) – Use this method to simulate typing into an element, which may set its value.

✅ clear() – If this element is a text entry element, this will clear the value.

✅ click() – Click this element.

✅ getAttribute(java.lang.String name) – Get the value of the given attribute of the element.

✅ getCssValue(java.lang.String propertyName) – Get the value of a given CSS property.

✅ getLocation() – Where on the page is the top left-hand corner of the rendered element?

✅ getSize() – What is the width and height of the rendered element?

✅ getTagName() – Get the tag name of this element.

✅ getText() – Get the visible text

✅ isDisplayed() – Is this element displayed or not? This method avoids the problem of having to parse an element’s “style” attribute.

✅ isEnabled() – Is the element currently enabled or not? This will generally return true for everything but disabled input elements.

✅ isSelected() – Determine whether or not this element is selected or not.

Selenium WebDriver Tutorial #17 – How to Handle Dropdown in Selenium-Part 1

In this Selenium Webdriver Tutorial we will learn How to Handle Dropdown in Selenium WebDriver. In this part-1 of handling dropdown tutorial we will learn how to use following methods for selecting values in drop down. Selenium provides Select class which has these methods to work with single select dropdowns.

✅ selectByIndex(int index) – Select the option at the given index.

✅ selectByValue(java.lang.String value) – Select all options that have a value matching the argument.

✅ selectByVisibleText(java.lang.String text) – Select all options that display text matching the argument.

Selenium WebDriver Tutorial #18 – How to Handle Dropdown in Selenium – Part 2

In this Selenium Webdriver Tutorial we will learn How to Handle Dropdown in Selenium WebDriver, I will walk through with examples for handling multi-select dropdowns. In this part-2 of handling dropdown tutorial we will learn about following methods in Select class of Selenium WebDriver.

✅ selectByIndex(int index) – Select the option at the given index.

✅ selectByValue(java.lang.String value) – Select all options that have a value matching the argument.

✅ selectByVisibleText(java.lang.String text) – Select all options that display text matching the argument.

✅ deselectAll() – Clear all selected entries.

✅ deselectByIndex(int index) – Deselect the option at the given index.

✅ deselectByValue(java.lang.String value) – Deselect all options that have a value matching the argument.

✅ deselectByVisibleText(java.lang.String text) – Deselect all options that display text matching the argument.

✅ getAllSelectedOptions()

Selenium WebDriver Tutorial #19 – How to Print all Links of a Webpage

In this Selenium Webdriver Tutorial we will learn how to print all links of a webpage in Selenium WebDriver. In many scenarios you would be required to verify the presence of links or common element types on page, this technique will help you to find those webelements which have some common attributes.

Selenium WebDriver Tutorial #20 – How to Handle Auto Suggestion Dropdown

In this Selenium Webdriver Tutorial we will learn How to Handle Auto Suggestion Dropdown in Selenium WebDriver. Nowadays many of the travel website implement autosuggestion search feature to display the results based on the initial word typed in the textbox, this can be handled in Selenium WebDriver using the technique shown in this video.