File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
tests/Files.InteractionTests Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
using OpenQA . Selenium . Appium ;
2
2
using OpenQA . Selenium . Appium . Windows ;
3
3
using System ;
4
+ using System . IO ;
4
5
using System . Diagnostics ;
5
6
using System . Threading ;
6
7
@@ -43,7 +44,18 @@ public static void CreateSession(TestContext _)
43
44
if ( _session == null )
44
45
{
45
46
// WinAppDriver is probably not running, so lets start it!
46
- Process . Start ( @"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" ) ;
47
+ if ( File . Exists ( @"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" ) )
48
+ {
49
+ Process . Start ( @"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" ) ;
50
+ }
51
+ else if ( File . Exists ( @"C:\Program Files\Windows Application Driver\WinAppDriver.exe" ) )
52
+ {
53
+ Process . Start ( @"C:\Program Files\Windows Application Driver\WinAppDriver.exe" ) ;
54
+ }
55
+ else
56
+ {
57
+ throw new Exception ( "Unable to start WinAppDriver since no suitable location was found." ) ;
58
+ }
47
59
48
60
Thread . Sleep ( 10000 ) ;
49
61
_session = new WindowsDriver < WindowsElement > ( new Uri ( WindowsApplicationDriverUrl ) , appiumOptions ) ;
You can’t perform that action at this time.
0 commit comments