← Back to team overview

sikuli-driver team mailing list archive

[Question #677354]: Can't invoke methods(click, hover, .. etc) from another script using IDE

 

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

Is it possible to so, please, observe my example:

script1.sikuli contents:

import Script2
Script2.runScript2()

script2.sikuli contents:

def runScript2():
    print("Try to click")
    click("Screen Shot 2019-01-06 at 18.17.22.png")
    print("DONE")


I run Script1 and get console output:

Try to click
[error] script [ Script1 ] stopped with error in line 2
[error] NameError ( global name 'click' is not defined )

[error] --- Traceback --- error source first
line: module ( function ) statement 
3: Script2 ( runScript2 ) click("Screen Shot 2019-01-06 at 18.17.22.png")
[error] --- Traceback --- end --------------



Why global name 'click' is not defined? Can you provide the right way how to run script from another script? Is it possible with IDE to so? Thanks.




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