- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 189 Articles for Selenium Web Driver

Updated on 22-Nov-2021 11:38:56
We can obtain the tagname of the parent element in 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 the child, by localizing it with the child and then passing (parent::*) as a parameter to the findElement(By.xpath()). Next, to get the tagname of the parent, we have to use the getTagName() method.Syntaxchild.findElement(By.xpath("parent::*"));Let us identify tagname of the parent of child element li in the below html code ... Read More 
Updated on 22-Nov-2021 11:34:51
We can obtain the page title using Selenium webdriver. The method getTitle() is used to obtain the present page title and then we can get the result in the console.Syntaxt = driver.getTitle();Let us find the title of the current page. We shall get About Careers at Tutorials Point – Tutorialspoint as output.ExampleCode Implementation.import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; public class PageTitle{ public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\Users\ghs6kor\Desktop\Java\chromedriver.exe"); //implicit wait driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); WebDriver driver = new ChromeDriver(); ... Read More 
Updated on 22-Nov-2021 11:21:12
We can handle frames in Selenium webdriver in Python. An iframe is identified with a tag in an html document. An iframe is an html document containing elements that reside inside another html document. Let us see an html document of a frame.The following methods help to switch between iframes −switch_to.frame(args) – The frame index is put as an argument to the method. The starting index of the iframe is 0.Syntaxdriver.switch_to.frame(0), switching to the first iframe.switch_to.frame(args) - The frame name or id is put as an argument to the method.Syntaxdriver.switch_to.frame("nm"), switching to the iframe with name nm.switch_to.frame(args) - The ... Read More 
Updated on 22-Nov-2021 11:19:22
We can interact with hidden elements in Selenium Webdriver. The hidden elements are the ones that are present in the DOM but not visible on the page. Mostly the hidden elements are defined by the CSS property style="display:none;". In case an element is a part of the form tag, it can be hidden by setting the attribute type to the value hidden.Selenium by default cannot handle hidden elements and throws ElementNotVisibleException while working with them. Javascript Executor is used to handle hidden elements on the page. Selenium runs the Javascript commands with the executeScript method. The commands to be run ... Read More 
Updated on 22-Nov-2021 11:15:19
We can get an attribute value of an element in the Selenium Webdriver. This is achieved with the help of the getAttribute method. In an html document, each element is identified with its tagname along with the element attributes with their values. To get an attribute value, we have to pass the element attribute as an argument to the getAttribute method.Let us see the html code of an element and obtain the value of its src attribute. The value of its src attribute shall be /about/images/logo.png.ExampleCode Implementation.import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; public class ... Read More 
Updated on 22-Nov-2021 10:46:47
The differences between Selenium RC and Webdriver are listed below −FeaturesSelenium WebdriverSelenium RCArchitectureNot acquired from Javascript.Acquired from Javascript.ServerNo server is needed to begin test case execution.The server is needed to begin test case execution.Object- OrientedIt is used widely for object-oriented programming.It is moderately used for object-oriented programming.BrowserIt can test all the leading browsers including execution in headless mode.It can test all the leading browsers.AlertsIt is capable of handling alerts.It is not capable of handling alerts.DropdownIt is capable of handling dropdowns.It is not capable of handling dropdowns.Dynamic LocatorsElements can be located with dynamic locators.Elements cannot be located with dynamic locators.Record and ... Read More 
Updated on 30-Nov-2020 11:02:41
We can find the release notes of Selenium webdriver. They reside within
the source control under the specific folder for the particular language libraries. Follow the steps one by one −Navigate to the link − http://docs.seleniumhq.org/.Click on the Download tab.Move to the Selenium Client & WebDriver Language Binding section.Click on the Change Log link for each of the languages. 
Updated on 30-Nov-2020 10:58:55
We can get Selenium to pause for X seconds with the concept of synchronization. There are two types of waits − implicit and explicit. Apart from this there is the Thread.sleep method that halts Selenium for a certain time. The wait time is passed as an argument to the method.ExampleCode Implementation with Thread.sleep.import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class ThreadWt{ public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\Users\ghs6kor\Desktop\Java\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://www.tutorialspoint.com/index.htm"); // identify element, enter text ... Read More 
Updated on 30-Nov-2020 10:58:01
We can use the ClickAt command in Selenium IDE. The ClickAt command has two arguments − the element locator and the coordinates which mentions the x and y coordinates of the mouse with respect to the element identified by the locator.This method is used when we want to click on a position having a specific mouse coordinate. It can click on a checkbox, radio button or link.SyntaxclickAt(locator, coordinates)In the Selenium IDE, Choose a row inside the test script edit box. Enter click at the Command field. To identify the dropdown with the id locator, enter the Target field. The x ... Read More 
Updated on 30-Nov-2020 10:55:10
We can scroll down with Selenium. Selenium is unable to handle scrolling directly. It takes the help of the Javascript Executor to perform the scrolling action up to an element.First of all we have to locate the element up to which we have to scroll to. Next, we shall use the Javascript Executor to run the Javascript commands. The method executeScript is used to run Javascript commands in Selenium. We shall take the help of the scrollIntoView method in Javascript and pass true as an argument to the method.SyntaxWebElement elm = driver.findElement(By.name("name")); ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", elm);Exampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; ... Read More Advertisements