-1

I try to write test for GUI app throw Winium + Selenium But main point, that I can't finished process what start throw test.

*** 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

I think that problem is winium, because I try this way with simple calc.exe, and it's working well.

How to kill GUI app? because throw Terminate Process it's not working(

Artem

  • I dont understand what you're asking :( – Goralight Jan 12 '17 at 16:21
  • I asked about how finished process, because GUI app not go down throw command 'Terminate Process' – Artem Semenov Jan 13 '17 at 11:00
  • What error? can you show me? or does it just do nothing? – Goralight Jan 13 '17 at 11:02
  • It's don't give me any error message. They perform test case and when go to suite_teardown just waiting for something. Then I can manual finished process in Task Manager and after this my test finished and create report – Artem Semenov Jan 13 '17 at 11:05
  • I need it for automatized test, and for my way it should be started and finished service.exe and gui.exe every time – Artem Semenov Jan 13 '17 at 11:07
  • What version of Python are you running? There is a limitation - `Graceful termination is not supported on Windows by Jython nor by Python versions prior to 2.7. Process is killed instead.` And you are calling `first`, which is a graceful termination – Goralight Jan 13 '17 at 11:21
  • I use Python 2.7.11 – Artem Semenov Jan 13 '17 at 14:24

1 Answers1

0

Best way to kill GUI it's navigate to 'Close' button