Find failed Error

Asked by Gokul_dev

 I am a beginner in testing field. I am getting a find failed error.

the code am using is :

package demosikuli;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Pattern;
import org.sikuli.script.Screen;

public class demo {

 public static void main(String[] args) throws FindFailed, InterruptedException {

WebDriver driver = new FirefoxDriver();

driver.manage().window().maximize();

driver.get("http://www.google.com");

Screen screen = new Screen();

Pattern image = new Pattern("C:\\images\\google.jpg");

screen.click(screen.wait(image, 10));

screen.type(image,"gmail");
  }
}

please provide suggestions and help me with the error..

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Tu Mi
Solved:
Last query:
Last reply:
Revision history for this message
Best Tu Mi (mailtumi) said :
#1

why do you want to access the image from local directory. Is it not better to include it into the project? Take a look on
http://sikulix-2014.readthedocs.io/en/latest/faq/030-java-dev.html

Revision history for this message
Gokul_dev (gokuldev1000) said :
#2

okay.. if i want to add images to project and use it from there then what should i do.? i have checked this link. but couldn't get a clear idea. i hav added the images to a folder inside the project. now how to add this to program. please help.

Revision history for this message
Gokul_dev (gokuldev1000) said :
#3

Thanks Tu Mi, that solved my question.

Revision history for this message
Gokul_dev (gokuldev1000) said :
#4

did some research and put your suggestion in practice. was a good suggestion. thnks mate.
problems solved :D