How to type text using Sikuli Java Standalone jar?

有些话、适合烂在心里 提交于 2019-12-12 03:43:54

问题


I am using Java Standalone APIs of Sikuli to automate my application.

I don't know how to provide/feed some text to any text-fields using this.


回答1:


Assuming that the cursor is currently active in a text field:

Keyboard kb = new DesktopKeyboard();
kb.type("Hello world");

Or, assuming that the field accepts paste and that you don't need to simulate the individual key-presses

kb.paste("Hello world");

If you have a set of fields and tab moves between them, you can do

kb.paste("Hello");
kb.type(Key.TAB);
kb.paste("World");



回答2:


Since the question is quite broad to answer, I'm giving you some useful links. You can find the Java development setup basis on the Sikuli Documentation.

Here's a more in-depth tutorial that also covers your exact problem, and all the available Javadocs.

Just use the type() method on the desidered locator.

With Sikuli-api try

Keyboard keyboard = new DesktopKeyboard();
keyboard.type("abc");

https://answers.launchpad.net/sikuli/+question/218670




回答3:


you can also use sikuli method type() in java program.

example:

 Screen screen=new Screen();

1st create object for screen. then call method type() using that reference.

screen.type("your text");


来源:https://stackoverflow.com/questions/15196238/how-to-type-text-using-sikuli-java-standalone-jar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!