SikuliX IDE to type path to input form

Asked by Akos Kovacs on 2018-12-07

I use following code in SikuliX IDE 1.1.4 to click in a text input field and type a folder path in it.

records = Dir.glob("**/*/")
records.each do |item|
    click("1544078258957.png")
    type(item)
end
I get error message:

[error] --- Traceback --- error source first line: class ( method ) file 77: RUBY ( block in click ) uri:classloader:/Lib/sikulix.rb 129: org.jruby.RubyMethod ( call ) org/jruby/RubyMethod.java 156: RUBY ( block in click ) uri:classloader:/Lib/sikulix.rb 7: RUBY ( )

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2018-12-18
Last query:
2018-12-18
Last reply:
2018-12-18
RaiMan (raimund-hocke) said : #1

type() only accepts some ASCII characters on an US keyboard (see docs)

try paste() instead.

Akos Kovacs (plaidshirtakos) said : #2

I tried that too, but field, where text should by typed is not clicked. I got error message for line click " ("1544078258957.png") ":

[error] script [ MyTest ] stopped with error in line 9
[error] FindFailed: 1544078258957.png: (475x32) in S(0)[0,0 1920x1080] E:Y, T ( (StandardError) org.sikuli.script.FindFailed: 1544078258957.png: (475x32) in S(0)[0,0 1920x1080] E:Y, T:3,0 )
[error] --- Traceback --- error source first line: class ( method ) file 77: RUBY ( block in click ) uri:classloader:/Lib/sikulix.rb 129: org.jruby.RubyMethod ( call ) org/jruby/RubyMethod.java 156: RUBY ( block in click ) uri:classloader:/Lib/sikulix.rb 9: RUBY ( block in (root) ) C:/_private/MyTest.sikuli 1801: org.jruby.RubyArray ( each ) org/jruby/RubyArray.java 8: RUBY ( <main> ) C:/_private/MyTest.sikuli [error] --- Traceback --- end

Best RaiMan (raimund-hocke) said : #3

--- [error] FindFailed: 1544078258957.png:

the image was not found. read the docs about FindFailed

Akos Kovacs (plaidshirtakos) said : #4

Thanks RaiMan, that solved my question.