problems when importing other sikuli script

Asked by Chang, HyukSoo

In the sub script named 'Common':

from sikuli import *
import time

def find_submenu_with_retry(mainMenu, subMenu):
    print('find_submenu_with_retry()')
    click(mainMenu)
    time.sleep(1)
    match1 = SCREEN.exists(subMenu)
    return match1

In the main script named 'AboutTest':

import Common
reload(Common)

aboutMenu="aboutMenu"
subMenu1="subMenu1"
#okButton1="subMenu11"

match1 = Common.find_submenu_with_retry(aboutMenu, subMenu1)

When I ran the main script, I got the following error messages:
[error] script [ AboutTest ] stopped with error in line 10
[error] NameError ( global name 'click' is not defined )
[error] --- Traceback --- error source first
line: module ( function ) statement
7: Common ( find_submenu_with_retry ) click(mainMenu)
10: main ( <module> ) match1 = Common.find_submenu_with_retry(aboutMenu, subMenu1)
[error] --- Traceback --- end --------------

I am using SikuliX IDE 2.1.0 and Java 17.
I don't know what's wrong.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Chang, HyukSoo
Solved:
Last query:
Last reply:
Revision history for this message
Chang, HyukSoo (hschang) said :
#1

I downloaded SikuliX 2.1.0-Snapshot from github.
My problem seems to be an error for this Snapshot version.
I just downloaded Sikulix 2.0.5 and tested my problem with it. My main script runs OK in the Sikulix 2.0.5.
Please regard my question as a bug report for SikuliX 2.1.0-Snapshot.
I will use Sikulix 2.0.5. My problem was solved.

Revision history for this message
aserty (atawe) said :
#3