简体   繁体   English

Sikuli @用Java登录

[英]Sikuli @ Sign with java

I have a string for my email-address: 我的电子邮件地址有一个字符串:

 String email = "dummy@web.de";

Now I want to type this email-address to a certain field on a web page. 现在,我想将此电子邮件地址键入网页上的某个字段。 So I do this 所以我这样做

 s.type("login.png", email);

but if I execute the application this will be typed 但是如果我执行该应用程序,将被键入

dummy"web.de 虚拟“ web.de

I have a german keyboard layout and on german keyboards the @-symbol is located on ALTGR + q . 我有德语键盘布局,在德语键盘上,@符号位于ALTGR + q上 So I modified the application like this 所以我这样修改了应用程序

s.click("login.png");
s.type("dummy");
s.keyDown(KeyModifier.ALTGR);
s.type("q");
s.keyUp(KeyModifier.ALTGR);

and the result is "dummy q" (with a space) 结果是“虚拟q”(带空格)

I also tried this 我也尝试过

s.type("q", KeyModifier.ALTGR);

but this will result in "dummyq" (without a space) 但这将导致“ dummyq”(无空格)

In case somebody needs this information, I use the following imports: 如果有人需要此信息,我将使用以下导入:

import org.sikuli.script.*;
import org.sikuli.basics.Debug;

and I use sikulixapi-1.1.0.jar 我使用sikulixapi-1.1.0.jar

Thanks for your help Hauke 感谢您的帮助Hauke

Found the solution by myself. 自己找到解决方案。 In order somebody has the same issue 为了有人有同样的问题

s.type("q", KeyModifier.ALT | KeyModifier.CTRL);

this fixed the problem. 这解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM