我尝试为GUI应用程序编写测试Winium + Selenium 但重点是,我无法完成什么开始测试。
*** Settings ***
Library Process
Suite Setup suite_setup
Suite Teardown suite_teardown
*** TestCases ***
testcase1
Click Element id=btnHome
Click Element id=tbLPN
Input Text id=tbLPN testtext
Click Element id=btnManualRequest
Click Element id=btnHome
*** Keywords ***
suite_setup
Start process C:\\test\\Winium.Desktop.Driver.exe shell=yes alias=first
Start process C:\\test\\Services.exe shell=yes alias=second
${procID1} = Get Process Id first #here I just checked that alias is working
${procID1} = Get Process Id second #here I just checked that alias is working
Import Library Selenium2Library
${winium_host}= Set Variable localhost
${winium_port}= Set Variable 9999
${capabilities}= Create Dictionary app=C:\\test\\Gui.exe
Create Webdriver Remote command_executor=http://${winium_host}:${winium_port} desired_capabilities=${capabilities}
sleep 8
suite_teardown
Terminate Process first True
我认为问题是winium,因为我用简单的calc.exe尝试这种方式,并且它运行良好。
如何杀死GUI应用程序?因为抛出终止进程它不起作用(
阿尔乔姆
答案 0 :(得分:0)
杀死GUI的最佳方法是导航到“关闭”按钮