简体   繁体   English

winium中如何按回车键

[英]How to press Enter button in winium

I'm trying to automate the test of winform application.我正在尝试自动化 winform 应用程序的测试。 But I have small problem.但我有一个小问题。 I can't press Enter button on textbox.我无法按文本框上的 Enter 按钮。 So what I tried to do:所以我试图做的是:

Actions act = new Actions(driver);
act.SendKeys(Keys.Enter).Perform(); 

Also I tried to insert the enter btn to my textbox, but this action simply delete my data in textbox.我还尝试将输入 btn 插入到我的文本框中,但此操作只是删除了我在文本框中的数据。

I should write name and then press enter to make the textbox work, but i don't know how else i can press it because there is no tutorials about winium.我应该写下名字,然后按回车键使文本框工作,但我不知道我还能怎么按它,因为没有关于 winium 的教程。 Thanks in advance for any help!在此先感谢您的帮助!

我使用这个命令使它工作。

driver.findElementByClassName("Edit").sendKeys("{ENTER}");

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

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