Category: Automation

How to read and write data in excel using selenium web driver with java

Read Data from excel in Java. public static XSSFSheet readExcel(String Path, String SheetName) { try { System.out.println(Path); // Open the Excel file FileInputStream ExcelFile = new FileInputStream(Path); // Access the required test data sheet ExcelWBook = new XSSFWorkbook(ExcelFile); ExcelWSheet = ExcelWBook.getSheet(SheetName); } catch (Exception e) { System.out.println(e); } return ExcelWSheet; } How to read data from excel in selenium web driver with java. To call the above method: XSSFSheet excelSheet = TestListener.readExcel("DataFiles\\testData.xlsx",

How to disable notification in chrome browser using selenium web driver with java

To perform automation with chrome browser’s tools selenium provide the ChromeOptions class in selenium lib. A class which contains the method to perform the operation like Proxy setting in the browser, enable popup, disable notification etc. How to disable notification in selenium web driver with java. The key point of the task. Create a object of

How to perform right click operation in selenium web driver using java

KeyPoints for the task  Create an object of Actions class. Actions action = new Actions(driver); Call the method to perform an action. action.contextClick(“Name of the element”).perform(); Task Scenario:  Open browser. Load the URL “http://www.seleniumeasy.com/test/”. Right click on the logo of the home page. Automate mouse events (Right click) in selenium web driver with an example.   import org.openqa.selenium.By;

Automate drag and drop event in selenium web driver using java

Automate drag and drop event in selenium web driver using java, To perform drag and drop operation in selenium. We need to use Actions class and its method. Actions class in selenium. Key Points for the task Create an object of Actions class. action.dragAndDrop(dragElement, dropElement).build().perform(); Call the method to perform an action. action.dragAndDrop(dragElement, dropElement).build().perform(); Automate

How to perform mouseover events in selenium web driver using java

Automate mouseover events in selenium web driver, To perform mouseover operation in selenium web driver we will use the Actions class. Actions class in selenium. Testcase scenario Open URL “codebun.com”. Perform mouseover operation on “Automation” in the menu. Click on selenium web driver submenu under the menu tab. Action class in selenium web driver with an example. package testCases;

How to automate login form using multiple users in selenium web driver in java.

Automate login form using multiple users in selenium web driver Task. Data-driven automation using selenium web driver. Here is the automation example using selenium web driver where we are going to automate login form using 100 users in selenium web driver in java. Task description is given below. Selenium web driver Task Description: Need to

Automate registration form using selenium web driver with java.

Automate Input fields using selenium. Automate Radio button using selenium. Automate checkbox using selenium. Automate drop down using selenium.   import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.Select; public class RegistrationPage { WebDriver driver; public void invokeBrowser() { try { { System.setProperty(“webdriver.chrome.driver”, “D:\\Chrome\\chromedriver.exe”); driver=new ChromeDriver(); driver.manage().window().maximize(); driver.manage().deleteAllCookies(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.manage().timeouts().pageLoadTimeout(40, TimeUnit.SECONDS);