Posts

Showing posts from 2019
How to handle dynamic WebTable In Selenium There are two ways of handling WebTable: Method – 1: • Iterate row and column and get the cell value. • Using for loop • Get total rows and iterate table • Put if(string matches) then select the respective checkbox • Lengthy method Method – 2: • Using custom XPath • Using parent and preceding-sibling tags • No need to write for loop • No full iteration of table • Single line statement • More dynamic • Efficient and fast package SeleniumSessions; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class DynamicWebTableHandle { public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver", "/Users/naveenkhunteta/Downloads/chromedriver"); WebDriver driver = new ChromeDriver(); // launch chrome driver.manage().window().maximize(); // ...

Highlight , Flash, pagedown, pageview ,generate alert,draw border - Java Script

/* 1. Highlight an Element 2. DrawBorder around an Element 3. Generate custom Alert during Test Execution 4. Click on an Element by using JaveScript 5. Refresh browser by using JavaScript 6. Get Title by using JavaScript 7. Get InnerText of page by using JavaScript 8. Scroll Into View and Scroll Page Down  *  */ package SeleniumSessions; import java.io.File; import java.io.IOException; import java.util.concurrent.TimeUnit; import org.apache.commons.io.FileUtils; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class JavaScriptExecutorConcept { public static void main(String[] args) throws IOException { System.setProperty("webdriver.chrome.driver", "/Users/naveenkhunteta/Downloads/chromedriver"); ...

Browsers Setting

package WebdriverStart; import org.openqa.selenium.PageLoadStrategy; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.firefox.internal.ProfilesIni; public class Firefoxprofiler { public static void main(String[] args) { //###################For selenium console data // System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE,"null");//no file will be generated at console System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE,"G:\\Prac_data\\testlog.txt");//no file will be generated at console // #################binary file(FirefoxOptions class) FirefoxOptions options= new FirefoxOptions(); options.setBinary("path of the firefox exe");//if selenium doesnt find the firefox.exe //##############PageLoadStrategy#################(FirefoxOptions class...

Extends Reports

Image
Extends Reports: Need Below Jars:

A Interview Questions- selenium

    Automation testing Interview Questions ================================= 1. What is Automation Testing? Automation testing is the process of testing the software using an automation tool to find the defects. In this process, executing the test scripts and generating the results are performed automatically by using automation tool. Some most popular tools do automation testing are HP QTP/UFT, SELENIUM Webdriver, etc., 2. What are the benefits of automation testing? ·          Saves time and money .Automation testing is faster in execution. ·          Reusability code, create one time and execute multiple times with less or no maintenance. ·          Easy reporting .It generates automatic reports after the test execution. ·          Easy for compatibility testing .It enables parallel execution in the...