Posts

Showing posts with the label webdriver

How to upload image using sikuli

Though webdriver handles the file uploading smartly but there are some time when you need to work with external tools such as AutoIT, again AutoIT doesn't go good with linux system hence we may use sikuli to upload the image. Click on link which will populate the file upload dialog, and take printscreen for Fileupload area and open button and save them in some location. Pattern fileLoad = new Pattern("{yourPath}/FileLoadInput.png"); Pattern openButton = new Pattern("{yourPath}/openButton.png"); Screen src = new Screen(); src.setAutoWaitTimeout(30); // Clear the input field if any is selected by default. src.type("a", Key.CTRL); src.type(Key.BACKSPACE); //Type in input filed name of the image and click on open button src.type(fileLoad, sFileName); src.click(openButton);

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