In this post I will show you how to integrate webdriver test script with Sikuli automation tool to handle window popup utility like file download and upload etc.
Here I take example of a file download window popup utility, which we can not handle by using webdriver functions. Some people use different-2 automation tool like AutoIt, java Robot class to handle this.
Here is an example of webdriver sikuli integration to handle below selenium jar file download window popup utility.
Here I take example of a file download window popup utility, which we can not handle by using webdriver functions. Some people use different-2 automation tool like AutoIt, java Robot class to handle this.
Here is an example of webdriver sikuli integration to handle below selenium jar file download window popup utility.
Here is an example of webdriver sikuli integration to handle popup utility.
public class WebdriverSikuli {
private
WebDriver driver;
private
String baseUrl;
private
Screen screen;
@BeforeSuite
public
void setUp() throws Exception {
driver
= new FirefoxDriver();
screen
= new Screen();
baseUrl
= "http://docs.seleniumhq.org/download/";
driver.manage().timeouts().implicitlyWait(30,
TimeUnit.SECONDS);
}
@Test
public
void testUntitled() throws Exception {
driver.get(baseUrl
+ "/");
driver.findElement(By.linkText("2.35.0")).click();
screen.click("images/SaveFileButton.png");
}
@AfterSuite
public
void tearDown() throws Exception {
driver.quit();
}
}
- In above example first of all you need to add “sikuli-script.jar” jar file to your project class path.
- Import Sikuli class >>>import org.sikuli.script.Screen;
- Create Screen class object and class click() method by passing image of save button .
- In above example “SaveFileButton.png” is image of save button and I put “images” folder under my project.
unable to click on image by using the same code
ReplyDeleteWhat issue you are getting?
Delete