Open gis2all opened 4 years ago
I saw a similar issue https://github.com/Microsoft/WinAppDriver/issues/367, I have tried this method but it didn't work
I guess you can write a function to invoke the driver programmatically and and run this function as part of class initialization. It can be written is C# like this.
System.Diagnostics.Process.Start(@"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe");
When we tried to get the winappdriver to start up and teardown at will on a windows 2016 server we had issues with the driver crashing immediately on start. It seemed like it was a permissions issue so we decided to use elevate.exe in a batch file to get the job done with a bat file:
cd "C:/Program Files (x86)/Windows Application Driver"
start /B elevate WinAppDriver.exe
exit
I had a similar problem and 'start WinAppDriver.exe ...' didn't help. Looks like Jenkins kills all started processes after stage end or switch to an agent.
This works for me:
wmic process call create "winappdriver.exe"
And if you want kill process after:
WMIC PROCESS where name="winappdriver.exe" TERMINATE
We were able to configure WAD on JENKINS using instructions here : https://github.com/microsoft/WinAppDriver/pull/1368
May I know if any solution works for you? @gis2all
@lovelyplanet2019 You can try to put the startup method to your test script, just like this python code
def start_winappdriver(executable_path: str, remote_debugging_port: int):
"""Start WinAppDriver
Args:
executable_path (str): WinAppDriver path
remote_debugging_port (int): port
"""
subprocess.Popen("{} {}".format(executable_path, remote_debugging_port))
All my test scripts are automatically executed with Jenkins, but before all tests start, WinAppDriver must be manually started in CMD. I want to start WinAppDriver in Jenkins. If I call it directly, it will exit directly, causing the test script to fail to start. Is there a better way to avoid this problem?