Business Automation Book

Business Automation Book

Business Automation book. Looking to automate business and cut cost, increase profitability. Digital Human Workers a beautiful book on mindset and thing to take care while automating any business  and replacing human employees.   Click to buy “Digital Human Workers” eBook from Amazon     Automate, Business, Increase Productivity.

Read More

Object Repository in Selenium

Object Repository in Selenium. How to create OR in Selenium. // Specify the file location I used . operation here because //we have object repository inside project directory only File src=new File(“.Object_Repo.properties”); // Create  FileInputStream object FileInputStream fis=new FileInputStream(src); // Create Properties class object to read properties file Properties pro=new Properties(); // Load file so we can use into our script pro.load(fis); System.out.println(“Property class loaded”); // Enter username here I used keys which is specified…

Read More

How to launch browser in Selenium webdriver

How to launch browser in Selenium webdriver

How to launch browser in Selenium webdriver. Opening browser is the first step to work on Selenium as it only supports web automation. By default Selenium is build to work on firefox. Launch Firefox using Selenium webdriver: WebDriver driver = new FirefoxDriver();   Launch Internet Explorer using Selenium webdriver: //To open IE browser System.setProperty(“webdriver.ie.driver”,”path of the iedriver.exe file ”); WebDriver driver = new InternetExplorerDriver();   Launch Chrome using Selenium webdriver: //To open Chrome browser System.setProperty(“webdriver.chrome.driver”,”path of…

Read More

handle alert pop-up in Selenium webdriver

handle alert pop-up in Selenium webdriver

handle alert pop-up in Selenium webdriver.   String mainPage = driver.getWindowHandle(); Alert alt = driver.switchTo().alert(); // to move control to alert popup alt.accept(); // to click on ok. alt.dismiss(); // to click on cancel. //Then move the control back to main web page- driver.switchTo().window(mainPage); → to switch back to main page.

Read More

Enter text without using sendKeys() in Selenium Webdriver

Enter text without using sendKeys() in Selenium Webdriver

Enter text without using sendKeys() in Selenium Webdriver. public static void setAttribute(WebElement element, String attributeName, String value) { WrapsDriver wrappedElement = (WrapsDriver) element; JavascriptExecutor driver = (JavascriptExecutor)wrappedElement.getWrappedDriver(); driver.executeScript(“arguments[0].setAttribute(arguments[1],arguments[2])”, element, attributeName, value); }

Read More
1 2