Installing and running Protractor AngularJS with Jasmine Webdriver and Astrolabe

Installing and running Protractor AngularJS with Jasmine Webdriver and Astrolabe Before you start anythink you will have to first install NodeJS. You can download and install NodeJS. http://nodejs.org/download/. After installation make sure its path is configured correctly, so that command execution can find Node. Once you have installed NodeJS open the command prompt and type […]

How to take the Screen shot in Selenium Grid

Here is the code that you can use to take the screen shot when running the script using Selenium Grid or Remote machine public void takeScreenshot() throws IOException { Random rand = new Random(); int num = rand.nextInt(150); File scrFile = null; Integer numNoRange = rand.nextInt(); WebDriver underlyingDriver = driver.getWrappedDriver(); if (browser.contains(“Remote”)) { try { […]

Read a XML test data in Java

Here is the code to read the xml test data coded in Java. import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Enumeration; import java.util.Properties; public class ReadXmlData { public String value; public String data(String node) { try { File file = new File(“../TestData.xml”); // XML file path FileInputStream fileInput = new FileInputStream(file); Properties properties […]