← Back to team overview

sikuli-driver team mailing list archive

[Question #403479]: Image page cannot be recognised by sikuli

 

New question #403479 on Sikuli:
https://answers.launchpad.net/sikuli/+question/403479

I want to click on radio button which is infront of save file option on "http://www.seleniumhq.org/download/"; web page .
I am working on Mac Os
Tool is Eclipse
Language is java
I have taken sand saved the image already at specified image path but still I am not sure what I am doing wrong.
I also need help with writing exact code to locate the button.
and yes I am very new to sikuli.
Error  which i am getting is ::
[error] Image: Image not valid, but TextSearch is switched off!
[error] Image: Image not valid, but TextSearch is switched off!
Exception in thread "main" FindFailed: Region: doFind: Image not loadable: P(/Users/vishalsrivastav/Documents/workspace/SeleniumTest/Save.png -- not valid!) S: 0.7
  Line 2535, in file Region.java

Thanks below is  snippet from my code



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

			WebDriver driver=new FirefoxDriver();
			//driver.get("http://www.seleniumhq.org/download/";);
			driver.get("http://www.google.com/";);
			driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
			driver.get("http://www.seleniumhq.org/download/";);
			driver.findElement(By.xpath(".//*[@id='close']")).click();
			driver.findElement(By.xpath(".//div[@id='mainContent']//td[text()='Java']/../td[4]/a[contains(text(),'Download')]")).click();
			Thread.sleep(2000);
			Screen screen=new Screen();
			Pattern radio=new Pattern("/Users/vishalsrivastav/Documents/workspace/SeleniumTest/Radio.png");
			Pattern save=new Pattern("/Users/vishalsrivastav/Documents/workspace/SeleniumTest/Save.png");
			Region r=screen.find(save);
			r.left().find("Radio.png").click();






-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.