sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #25711
Re: [Question #248190]: How to Switch Browser between Sikuli and Selenium Webdriver
Question #248190 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/248190
Status: Answered => Open
Atul Mirvankar is still having a problem:
Hi RaiMan,
I went through links provided. I followed the instructions mentioned in
http://sikulix-2014.readthedocs.org/en/latest/faq/030-java-dev.html#how-
to-use-sikulix-api-in-your-java-programs . However, I was not able to
download and install "sikulixapi.jar".
However, I have wrote the below script:
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Screen;
import org.sikuli.script.*;
public class BrowserApp {
public static void main(String[] args) throws InterruptedException, FileNotFoundException, IOException, FindFailed {
Properties deskIcon = new Properties();
deskIcon.load(new FileInputStream("D:\\SeleniumPractice\\WebandDesk\\OR\\PropertyFiles\\DeskIcons.properties")); //This is the path where I have saved my images.
Screen srn = new Screen();
FirefoxDriver driver = new FirefoxDriver();
driver.get("https://qasharedv5.halfpenny.com/");
driver.manage().window().maximize();
Thread.sleep(2000);
srn.click(deskIcon.getProperty("User_Name")); //To locate the textbox on the screen
srn.type("Hi"); //To type "Hi" in above mentioned textbox.
}
}
I am getting below error message:
Exception in thread "main" FindFailed: can not find D:\SeleniumPractice\WebandDesk\OR\DesktopIcons\User_Name.png on the screen.
Line 1574, in file Region.java
at org.sikuli.script.Region.handleFindFailed(Region.java:1574)
at org.sikuli.script.Region.wait(Region.java:1682)
at org.sikuli.script.Region.find(Region.java:1590)
at org.sikuli.script.Region.getLocationFromTarget(Region.java:1991)
at org.sikuli.script.Region.click(Region.java:2197)
at org.sikuli.script.Region.click(Region.java:2181)
at BrowserApp.main(BrowserApp.java:26)
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.