-3

I am trying to automate a web application using selenium webdriver (Eclipse IDE), selenium was not able to identify a particular element (even though it had Xpath) so I tried to integrate sikuli with Java Eclipse. I recorded the click in Sikuli and saved the script took that image into Java code and tried but it was throwing an error: FindFailed: can not find Pattern("C:\1424416444710.png").similar(0.7) on the screen.

Below is the code I used in Eclipse:

  try  
       { Screen s = new Screen();  
         System.out.println("Trying to find the image");  
         Pattern image = new Pattern("C:\\1424416444710.png");  
         s.wait(image, 10);  
         s.click(image);  
       }
    catch (Exception e)  
       {  
         e.printStackTrace();  
       }  
Andremoniy
  • 34,031
  • 20
  • 135
  • 241
Vinod
  • 376
  • 2
  • 11
  • 34
  • Adding on... While running the script through Sikuli IDE am able to see the required click is happening. – Vinod Feb 20 '15 at 08:30
  • It is people-who-don't-know-how-to-use-debug invasion on SO – Andremoniy Feb 20 '15 at 08:40
  • Go back to selenium, and post a question with your code & html document if you're stuck. That'll be a lot easier to help with. Or add your image & html to this question. – Dave Feb 20 '15 at 08:48

1 Answers1

0

I ran Sikuli IDE again and captured the image and passed that to Java code, now Eclipse is able to recognize the image.

Vinod
  • 376
  • 2
  • 11
  • 34