I am new to Sikuli. I am trying to setup an automated test suite using Sikuli and Cucumber.
Below is my step definition:
When(/^I click on DLM icon in the dock$/) do
puts "Init"
puts "Setting up screen"
@screen=Sikuli::Screen.new
puts "Going to click..."
@screen.click("/Users/shrivaw1/Documents/Anshul/Testing/DLM/Automation/cucumber/features/images/dlm-ico.png") # click the DLM icon
end
When I run the code I always get the below error:
The image '/Users/shrivaw1/Documents/Anshul/Testing/DLM/Automation/cucumber/features/images/dlm-ico.png' did not match in this region. (Sikuli::ImageNotFound)
./features/step_definitions/dlm.rb:16:in `/^I click on DLM icon in the dock$/'
features/feature_files/dlm.feature:7:in `When I click on DLM icon in the dock'
It says the image did not match in this region. (Sikuli::ImageNotFound).
I tried this with many different images but same error is observed. Even though the image is there is the region. Surely I am missing something here. Can anyone please help me get this issue resolved? If anyone has created automation framework using Sikuli and Cucumber, please share your experience and some best practices. Thanks in advance.
Apparently, the issue was with Mac default screen capture tool (Cmd + Shift + 4). The screen shots taken were too large to be recognised in the screen. When I resized the images to 50%, it worked correctly.
Thanks to Eugene S for your answer though.
Thanks, Anshul