Image : Image text is not valid , but SearchText is switched off!!

Asked by Sonali on 2018-07-27

I am facing below two issues intermediary in SikuliX:
 - Image : Image text is not valid , but SearchText is switched off!!
 - Issues in importing module - No module named ----- present(any module name)

Also it works when I comment and uncomment the modules which are in Checkbalance.sikuli. I know this is strange and weird but it works something for me

My scripts are stored in below location:

C:\tmp\Test.sikuli
  -Images.Sikuli (#All images used in all the below sikuli scripts are stored here and assigned to a variable and rest of the sikuli programs are using that variable name)
  -OpenApplications.Sikuli
  -Checkbalance.Sikuli
   -Addition.Sikuli (This .sikuli file is inside Checkbalance.Sikuli)
   -Interest.Sikuli
   -Mortgage.Sikuli
  -StandardBal.Sikuli
  -CaptureScreenshots.Sikuli
  -SOP.Sikuli --> main Sikuli file

SOP.Sikuli

from sikuli import *
import Images
reload(Images)
import OpenApplications
reload(OpenApplications)
import(Checkbalance)
reload(Checkbalance)
import(Addition)
reload(Addition)
import(Interest)
reload(Interest)
import StandardBal
reload(StandardBal)
import logging
reload(logging)
import unittest
import HTMLTestRunner
import CaptureScreenshots
reload(CaptureScreenshots)
import shutil
import os
global img,file

def setUp(self):
    Images.images()
    #tear down happens after tests compelte and should close anything that was opened
def tearDown(self):
    OpenApplications.CloseApp()
    self.app.close()
    #slight delay for safety(probably nto needed)

rest of the code... where functions which are present in above sikuli programs/modules are called.

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-07-31
Last reply:
2018-08-02
RaiMan (raimund-hocke) said : #1

Use latest 1.1.3 nightly build.

Sonali (sachchirp) said : #2

Hi Raiman,

As suggested I have used the latest build 1.1.3 but no luck.

Still issue in finding images

[error] Image: Image not valid, but TextSearch is switched off!
[error] RunTimeIDE: ImageMissing: Start

TestMechanic (ndinev) said : #3

Provided code example is complex and uncompleted. Try to isolate your problem just to 2-3 files max.

RaiMan (raimund-hocke) said : #4

ok, this you have:

# images.sikuli # containing
img1 = "image1.png"
…. more of them

# main.sikuli # containing
from images.sikuli import *
find(img1)

if both .sikuli are in the same folder, then this should work.

BTW: with 1.1.3+ the reload() after an import() is no longer needed.

… and the main script does not need
from sikuli import *

to check your situation, add the following to the function setup():
for entry in sys.path: print entry # should show all your imports

Can you help with this problem?

Provide an answer of your own, or ask Sonali for more information if necessary.

To post a message you must log in.