- 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 719 Articles for Testing Tools
![Debomita Bhattacharjee](https://www.tutorialspoint.com/assets/profiles/210947/profile/60_171666-1594382095.jpg)
3K+ Views
We can set browser width and height in Selenium webdriver. There are multiple methods available to achieve this. Whenever an application is launched, it opens in its default browser size.We can resize the browser with the help of the Dimension class in Java. We create an object of the Dimension class and pass the desired width and height of the browser as parameters to that class. Finally we pass the object of the Dimension class as an argument to the setSize method.SyntaxDimension dem = new Dimension(750, 450); driver.manage().window().setSize(dem);We can also set the browser width and height with the help of Chrome ... Read More
![Debomita Bhattacharjee](https://www.tutorialspoint.com/assets/profiles/210947/profile/60_171666-1594382095.jpg)
3K+ Views
We can get the return value of Javascript code with Selenium webdriver. Selenium can run Javascript commands with the help of executeScript method. The Javascript command to be executed is passed as an argument to the method.We shall be returning the value from the Javascript code with the help of the keyword return. Also we have to add the statement import org.openqa.selenium.JavascriptExecutor to work with Javascript.SyntaxJavascriptExecutor j = (JavascriptExecutor) driver; j.executeScript("return document.getElementsByName('txtSearchText')[0].value")Let us obtain the value entered in the edit box. The output should be Selenium.ExampleCode Implementationimport 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; import org.openqa.selenium.JavascriptExecutor; public class ... Read More
![Debomita Bhattacharjee](https://www.tutorialspoint.com/assets/profiles/210947/profile/60_171666-1594382095.jpg)
8K+ Views
We can verify an xpath expression in Chrome Developer tool or with Firefox Firebug. We can open the Developer tool in Chrome by pressing F12, then the Console tab is to be selected. We can validate the xpath with the $x("") expression.On clicking Enter after entering the expression, an array of matching elements will be displayed. On hovering over the returned result, the actual element gets highlighted on the page. If there are no matching elements, an empty array shall be returned.We also verify the xpath expression from the Firefox’s Firebug. First of all, we have to install the extensions ... Read More
![Debomita Bhattacharjee](https://www.tutorialspoint.com/assets/profiles/210947/profile/60_171666-1594382095.jpg)
691 Views
We can open Chrome browser in Selenium webdriver. We can launch Chrome by instantiating an object of the ChromeDriver class with the help of the below statement.WebDriver driver = new ChromeDriver();Next we have to download the chromedriver and configure it to our project by following the below step by step processes −Navigate to the link − https://www.selenium.dev/downloads/ and below the Browser, there is a Chrome section available. Click on the documentation link just below that.As per version of the Chrome browser in the system, we have to select the download link. The next page shall be navigated where links to ... Read More
![Debomita Bhattacharjee](https://www.tutorialspoint.com/assets/profiles/210947/profile/60_171666-1594382095.jpg)
356 Views
The geckodriver can be used in 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 then launch the Firefox browser by instantiating an object of FirefoxDriver class with the help of the below statement.WebDriver driver=new FirefoxDriver();Next we have to download the geckodriver and configure it to our project by following the below step by step processes −Navigate to the link −https://www.selenium.dev/downloads/ and move below the Browser section, there will be Firefox text present. Click on the Documentation link just below that.All ... Read More
![Debomita Bhattacharjee](https://www.tutorialspoint.com/assets/profiles/210947/profile/60_171666-1594382095.jpg)
675 Views
We can run Selenium webdriver test cases in Chrome browser. But before working with Chrome browser with Selenium we have to ensure that the Java JDK, any Java IDE like Eclipse and Selenium webdriver are configured in our system. Next we have to download the Chrome browser driver and configure it to our project by following the below step by step process −Navigate to the link − https://chromedriver.chromium.org/downloads and there links shall be available to the multiple versions of the chromedriver.As per the available version of the Chrome browser in the system, we have to select the download link. The ... Read More
![Debomita Bhattacharjee](https://www.tutorialspoint.com/assets/profiles/210947/profile/60_171666-1594382095.jpg)
329 Views
We can install the Selenium latest version in our machine. It involves the below step by step processes −Java Installation.Eclipse IDE installation.Selenium Webdriver installation.Selenium is supported by multiple languages, here we shall discuss Selenium installation with Java.Navigate to the link −https://www.oracle.com/java/technologies/javasedownloads.html and then select JDK Download link. All the list of downloadable links get populated under the Java SE Development Kit Section.Next choose the download link as per the system configuration and accept the license agreement checkbox.Navigate to Start and find the System and navigate to it. Then select Advanced System Settings. Next under Advanced Tab click on Environment Variables.Under the ... Read More
![Debomita Bhattacharjee](https://www.tutorialspoint.com/assets/profiles/210947/profile/60_171666-1594382095.jpg)
439 Views
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.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 dropdown.It is not capable of handling dropdown.Dynamic LocatorsElements can be located with the dynamic locators.Elements cannot be located with the ... Read More
![Debomita Bhattacharjee](https://www.tutorialspoint.com/assets/profiles/210947/profile/60_171666-1594382095.jpg)
544 Views
We can get the href of elements found by partial link text with Selenium webdriver. First of all we need to identify the links with help of the find_elements_by_partial_link_text() method.Next to get hold of href of the links we have to use the get_attribute() method and then pass href as a parameter to the method.Let us identify the href attribute of links identified with partial link text Policy in the below page.Examplefrom selenium import webdriver driver = webdriver.Chrome(executable_path="C:\chromedriver.exe") driver.implicitly_wait(0.5) driver.get("https://www.tutorialspoint.com/about/about_careers.htm") #identify links with partial link text l= driver.find_elements_by_partial_link_text("Policy") #iterate links for i in l: #get href from get_attribute() print("Href value ... Read More
![Debomita Bhattacharjee](https://www.tutorialspoint.com/assets/profiles/210947/profile/60_171666-1594382095.jpg)
9K+ Views
We can find an element in a sub-element with Selenium webdriver. First of all we need to identify the element with help of any of the locators like id, class, name, xpath or css. Then we have to identify the sub-element with the findElements(By.xpath()) method.We can identify the sub-element from the element, by localizing it with the element and then passing the expression (./child::*) as a parameter to the findElements(By.xpath())Syntaxelement.findElements(By.xpath("./child::*"))Let us identify the tagname of the sub-elements of element ul in below html code−Exampleimport 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 SubElement{ public static ... Read More