can not find images.sikuli/1390382312030.png on the screen

Asked by karamjeet kaur

how to read images in eclipse in ubuntu . I have a folder name images.sikuli and all my images are stored inside it ..And in my code I have path as
   s.doubleClick("images.sikuli/1390382312030.png")

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
karamjeet kaur
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

looks like you are using Java?

If yes, how do you run your app?

Revision history for this message
karamjeet kaur (karamjeet-kaur) said :
#2

Yes using java load my test case with ant
<target name="runTest" depends="compile">
    <junit printsummary="yes" haltonfailure="no">
    <classpath>
     <pathelement location = "lib/sikuli-java.jar"/>
        <pathelement path="${build.dir}/classes" />
        <pathelement path="seleniumClasses"/>
     </classpath>
        <formatter type="xml"/>
     <batchtest fork="yes" todir="reports/xml">
       <fileset dir="src">
      <include name="**/*productTest*.java"/>
     </fileset>
    </batchtest>
      </junit>
        <junitreport todir="reports">
           <fileset dir="reports/xml">
     <include name="TEST-*.xml"/>
    </fileset>
    <report format="frames" todir="reports/html" />
      </junitreport>
       </target>

Revision history for this message
RaiMan (raimund-hocke) said :
#3

--1: generally you should NOT put sikuli-java.jar into your project folder.
like every other common library, sikuli-java.jar should be kept in one place (preferably the setup folder) and should only be referenced in your runtime environment.
something like that:
<pathelement location = "${my.Sikuli}"/>

having set this property somewhere at the beginning or generally in your environment.

This makes it easier to switch to new Sikuli versions and avoids spamming your system with copies of sikuli-java.jar and the at runtime created libs folder.

--2:
as generally with Java apps: relative folder names like lib/sikuli-java.jar or images.sikuli/1390382312030.png are resolved to the current folder the JVM is running in (working folder). In your case this is the folder, where you fire the ant execution.
So in your case I guess this is your project folder. so the folder images.sikuli must be here.

Revision history for this message
karamjeet kaur (karamjeet-kaur) said :
#4

I have set the path exactly you are telling . tcw is name of my project suppose there is folder named images.sikulii where my .png images are kept , then lib folder where sikuli-java.jar is kept and inside lib I have libs folder like lib/libs where .so files are there. then there is build.xml
where sikuli-java.jar path is set like
 <pathelement path="${build.dir}/classes" />
and jar and .so file path are set as
  <fileset dir="${lib.dir}" includes="*.jar" />
     <fileset dir="${lib.dir}/libs" includes="*.so"/>
then my .java fille is kept in tcw/src/com/selenium/thecharmTest.java
public void testUntitled() throws Exception {
    driver.get("www.thecharmworks.com");
    driver.findElement(By.xpath("html/body/div[4]/footer/div[1]/div/div[2]/a/img")).click();
    Debug.setDebugLevel(3);
    Settings.OcrTextRead =true;
   // s.type(Key.DOWN, Key.DOWN, Key.DOWN);
    s.setAutoWaitTimeout(2);
    s.exists("Start Building Now");
    s.waitVanish(2);
    s.doubleClick("images.sikuli/1390382312030.png");
    System.out.println("++++++"+ s.doubleClick("/1390382312030.png"));
    s.wait(2);
    s.doubleClick("1390382392318.png");
    s.wait(2);
}

But still I am getting <error message="Text search currently switched off" type="org.sikuli.script.FindFailed">FindFailed: Text search currently switched off
  Line 1671, in file Region.java

 at org.sikuli.script.Region.wait(Region.java:1671)
 at org.sikuli.script.Region.find(Region.java:1590)
 at org.sikuli.script.Region.getLocationFromTarget(Region.java:1991)
 at org.sikuli.script.Region.doubleClick(Region.java:2246)
 at org.sikuli.script.Region.doubleClick(Region.java:2230)
 at com.thecharmworks.selenium.CharmWorksBraceletBuilderTest.testUntitled(CharmWorksBraceletBuilderTest.java:48)
 at com.thecharmworks.selenium.CharmWorksBraceletBuilderTest.setUp(CharmWorksBraceletBuilderTest.java:22)
</error>
  </testcase>
  <system-out><![CDATA[[debug] Screen.capture: java.awt.Rectangle[x=0,y=0,width=1366,height=768]
[debug] RobotDesktop: captureScreen: on 0 using java.awt.Rectangle[x=0,y=0,width=1366,height=768]
[debug] ResourceLoaderBasic: SikuliX Package Build: 1.0.1 12SEP2013135849
[debug] ResourceLoaderBasic: check: we are running on arch: amd64
[debug] ResourceLoaderBasic: check: using Java at: /usr/lib/jvm/jdk1.6.0_38/jre/
[debug] ResourceLoaderBasic: check: Exists libs folder at location of jar? YES: /home/paridhi/projects/tcw-ofbiz/hot-deploy/tcw/lib/
[debug] ResourceLoaderBasic: checkLibsDir: /home/paridhi/projects/tcw-ofbiz/hot-deploy/tcw/lib/libs
[debug] ResourceLoaderBasic: loadLib: JXGrabKey
[debug] ResourceLoaderBasic: loadLib: Found: JXGrabKey
[debug] ResourceLoaderBasic: loadLib: Now loaded: JXGrabKey
[debug] ResourceLoaderBasic: checkLibsDir: Using libs at: /home/paridhi/projects/tcw-ofbiz/hot-deploy/tcw/lib/libs
[debug] ResourceLoaderBasic: loadLib: VisionProxy
[debug] ResourceLoaderBasic: loadLib: Found: VisionProxy
[debug] ResourceLoaderBasic: loadLib: Now loaded: VisionProxy
[error] Region.find(text): text search is currently switched off
[error] Region.exists: seems that imagefile could not be found on disk
[debug] waiting for 2 to vanish
[debug] Screen.capture: java.awt.Rectangle[x=0,y=0,width=1366,height=768]
[debug] RobotDesktop: captureScreen: on 0 using java.awt.Rectangle[x=0,y=0,width=1366,height=768]
[error] Region.waitVanish: seems that imagefile could not be found on disk
[debug] waiting for /1390382312030.png to appear
[debug] Screen.capture: java.awt.Rectangle[x=0,y=0,width=1366,height=768]
[debug] RobotDesktop: captureScreen: on 0 using java.awt.Rectangle[x=0,y=0,width=1366,height=768]
[error] /1390382312030.png looks like a file, but not on disk. Assume it's text.
[error] Region.find(text): text search is currently switched off

error or images cannot be found.

Revision history for this message
RaiMan (raimund-hocke) said :
#5

see the comments //

    s.exists("Start Building Now"); // this is interpreted as text, but text search is switched of (no valid image file name)
    s.waitVanish(2); // 2 is not recognised waitVanish needs an image filename or a pattern
    s.doubleClick("images.sikuli/1390382312030.png"); // this is valid and should be found
    System.out.println("++++++"+ s.doubleClick("/1390382312030.png")); // invalid file name, at system root ??
    s.wait(2);
    s.doubleClick("1390382392318.png"); // valid filename but will not be found
    s.wait(2);

a valid filename in your case is either
<some absolute path>/some-image.png

or
<some relative path>/some-image.png
where <some relative path> is a folder in your project folder

Revision history for this message
karamjeet kaur (karamjeet-kaur) said :
#6

I am using exact configuration as you mentioned
public void testUntitled() throws Exception {
     driver.get("http://www.thecharmworks.com");
    driver.findElement(By.xpath("html/body/div[4]/footer/div[1]/div/div[2]/a/img")).click();
    Settings.OcrTextRead =true;
    Debug.setDebugLevel(3);
  s.setAutoWaitTimeout(2);
    s.exists("home/karamjeet/projects/charm/hot-deploy/tcw/images.sikuli/1390382312030.png");
    s.waitVanish("home/karamjeet/projects/charm/hot-deploy/tcw/images.sikuli/1390382312030.png"); s.doubleClick("home/karamjeet/projects/charm/hot-deploy/tcw/images.sikuli/1390382312030.png");
     s.wait(2);
    s.doubleClick("home/karamjeet/projects/tcw-ofbiz/hot-deploy/charm/images.sikuli/1390382392318.png");
    s.wait(2););
    s. hover("home/karamjeet/projects/tcw-ofbiz/hot-deploy/charm/images.sikuli/1390382826414.png");
    s.doubleClick("images.sikuli/1390382861254.png");
    s.wait(2);
    s.exists("home/karamjeet/projects/tcw-ofbiz/hot-deploy/charm/images.sikuli/1390383721795.png");
    s.dragDrop("home/karamjeet/projects/tcw-ofbiz/hot-deploy/charm/images.sikuli/1390383732435.png", "home/karamjeet /projects/tcw-ofbiz/hot-deploy/charm/images.sikuli/1390383738548.png");
    s.wait(2);
    s.doubleClick("home/karamjeet/projects/tcw-ofbiz/hot-deploy/charm/images.sikuli/1390384080473.png");
    s.wait(4);
    s.exists("home/karamjeet/projects/tcw-ofbiz/hot-deploy/charm/images.sikuli/1390384299725.png");
    s.wait(2);
    assertTrue(true);

but the errorlog is saying
<error message="Text search currently switched off" type="org.sikuli.script.FindFailed">FindFailed: Text search currently switched off
  Line 1671, in file Region.java

 at org.sikuli.script.Region.wait(Region.java:1671)
 at org.sikuli.script.Region.find(Region.java:1590)
 at org.sikuli.script.Region.getLocationFromTarget(Region.java:1991)
 at org.sikuli.script.Region.doubleClick(Region.java:2246)
 at org.sikuli.script.Region.doubleClick(Region.java:2230)
 at com.thecharmworks.selenium.CharmWorksBraceletBuilderTest.testUntitled(CharmWorksBraceletBuilderTest.java:49)
 at com.thecharmworks.selenium.CharmWorksBraceletBuilderTest.setUp(CharmWorksBraceletBuilderTest.java:22)
</error>
  </testcase>
  <system-out><![CDATA[[debug] Screen.capture: java.awt.Rectangle[x=0,y=0,width=1366,height=768]
[debug] RobotDesktop: captureScreen: on 0 using java.awt.Rectangle[x=0,y=0,width=1366,height=768]
[debug] ResourceLoaderBasic: SikuliX Package Build: 1.0.1 12SEP2013135849
[debug] ResourceLoaderBasic: check: we are running on arch: amd64
[debug] ResourceLoaderBasic: check: using Java at: /usr/lib/jvm/jdk1.6.0_38/jre/
[debug] ResourceLoaderBasic: check: Exists libs folder at location of jar? YES: /home/paridhi/projects/charm/hot-deploy/tcw/lib/
[debug] ResourceLoaderBasic: checkLibsDir: /home/paridhi/projects/charm/hot-deploy/tcw/lib/libs
[debug] ResourceLoaderBasic: loadLib: JXGrabKey
[debug] ResourceLoaderBasic: loadLib: Found: JXGrabKey
[debug] ResourceLoaderBasic: loadLib: Now loaded: JXGrabKey
[debug] ResourceLoaderBasic: checkLibsDir: Using libs at: /home/paridhi/projects/charm/hot-deploy/tcw/lib/libs
[debug] ResourceLoaderBasic: loadLib: VisionProxy
[debug] ResourceLoaderBasic: loadLib: Found: VisionProxy
[debug] ResourceLoaderBasic: loadLib: Now loaded: VisionProxy
[error] home/paridhi/projects/tcw-ofbiz/hot-deploy/charm/images.sikuli/1390382312030.png looks like a file, but not on disk. Assume it's text.
[error] Region.find(text): text search is currently switched off
[error] Region.exists: seems that imagefile could not be found on disk
[debug] waiting for home/paridhi/projects/charm/hot-deploy/tcw/images.sikuli/1390382312030.png to appear
[debug] Screen.capture: java.awt.Rectangle[x=0,y=0,width=1366,height=768]
[debug] RobotDesktop: captureScreen: on 0 using java.awt.Rectangle[x=0,y=0,width=1366,height=768]
[error] home/paridhi/projects/charm/hot-deploy/tcw/images.sikuli/1390382312030.png looks like a file, but not on disk. Assume it's text.
[error] Region.find(text): text search is currently switched off

Really tensed about it. Not working good. Does sikuli works in ubuntu using eclipse ?

Revision history for this message
RaiMan (raimund-hocke) said :
#7

   s.exists("home/karamjeet/projects/charm/hot-deploy/tcw/images.sikuli/1390382312030.png");

look comment #5:
this is a relative path, that is resolved relative to your project folder, and I guess it is not there but at
/home/karamjeet/projects/...

*** you say:
Really tensed about it. Not working good. Does sikuli works in ubuntu using eclipse ?

Of course does it work and I guess some thousand people around the world are using it successfully.

*** and now it is getting unobjective and might be unpolite and I dare to talk:

- I know, who you are and we already had this behaviour discussion privately

- you tend to blame other people or stuff to be responsible for your failures

- you are wasting peoples time in that you are asking silly questions, that are silly, because you do not try to understand the answers you get (... and on top you say: I am using exact configuration as you mentioned - LOL)

... and you are trying to cheat people:
after I have cut the private communication recently, you come here with some other name and even dare to come up with code, that does not fit with the log you are posting with respect to the "error" to disguise yourself.
code: home/karamjeet/projects/
log: /home/paridhi/projects/

I really hope, that after more than 10 days creeping around with 10 lines of basic Sikuli Java coding, that you get on the road now.

Revision history for this message
karamjeet kaur (karamjeet-kaur) said :
#8

I am karamjeet . We are working in a team and paridhi is our team mate . Before thinking just know that things can be other way aswell..She advised me to take help from you. Anyways thanks in further our team don't need your help because you are quite impatient and presume thinks by your own if someone needs help thats why he/she is asking for it. Anyways thanks for your answers. Good Luck

Revision history for this message
RaiMan (raimund-hocke) said :
#9

I already mentioned:
*** and now it is getting unobjective and might be unpolite and I dare to talk:

... and this is always a glitchy way - but sometimes, very seldom, I have to shout out how I feel.

... and that you are working together in a team even makes things worth, since this means, that you do not learn from each other and do not communicate about what has happened (again a might be invalid presumption ;-)

... and from beginning giving some information on background and history helps a lot. Many people do that and admit from beginning, that they might have missed something or having done something wrong.

In this case (SHE knew the problem!) some reference and explanation would have given a better base from beginning, instead of just asking the same question with the same complains and coding as before.

So: no excuses from my side.

*** you say:
 you are quite impatient and presume thinks by your own if someone needs help

this might in the end look so for you from your standpoint being frustrated to not get nearer to the solution.

*** But be assured:
I am very, very patient - otherwise I could not have managed to support Sikuli now for more than 3 years having helped hundreds of people - many of them being totally new to scripting or even programming, which needs to be one of the most patient people on the world.

Nevertheless: I wish you all the best for your work.

... and be assured: if you come back again with any new question, I will have a look at it and try to help you - very, very patiently ;-)