Posts

Showing posts from August, 2014

How to generate string with given range.

Say there is drop down list to select range e.g. 1-9 and based on that range you need to input value in text field having length equal to range. public class testlength { public static String test(int idgit) { String s = null; Random m = new Random();       // take a temp string and initialize it randomly or hardcoded it String temp = "5" //Integer.toString(m.nextInt(8)); for(int i=1; i<idgit+k;i++) { int j= m.nextInt(8);     s = Integer.toString(j);     temp = temp+s; } return temp; }

Architecture of Webdriver

Image
The webdriver API directly starts and control the browser against the Selenium RC where you need to start the server first which in turns inject its javascript into browser and control them. The core of the Webdriver API are: Language Binding: The supported language in which you are developing your automation framework called Selenese. There are several language bindings few of are here Webdriver : Webdriver accepts the command sent by Selenese or via client API and sends them to browser Drivers: The drivers are browser specific which knows how to drive the particular browser or in other words knows how to click a button, link or fetch text etc from that browser. e.g. for Google chrome there is chromedriver which can be downloaded from here