Skip to content

Commit

Permalink
Winium.Cruciatus update and checking for not founded window
Browse files Browse the repository at this point in the history
  • Loading branch information
zebraxxl committed Oct 20, 2015
1 parent 3a0b2e0 commit 005e905
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
#region using

using System.Windows.Automation;

using Winium.Cruciatus;
using Winium.Cruciatus.Core;
using Winium.StoreApps.Common;
using Winium.StoreApps.Common.Exceptions;

#endregion

Expand All @@ -19,6 +20,10 @@ protected override string DoImpl()

var handleProperty = AutomationElement.NativeWindowHandleProperty;
var window = CruciatusFactory.Root.FindElement(By.AutomationProperty(handleProperty, windowHandle));
if (window == null)
{
throw new AutomationException("Window cannot be found", ResponseStatus.NoSuchElement);
}

window.SetFocus();

Expand Down
2 changes: 1 addition & 1 deletion src/Winium.Desktop.Driver/Winium.Desktop.Driver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Winium.Cruciatus, Version=2.7.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Winium.Cruciatus.2.9.0\lib\net45\Winium.Cruciatus.dll</HintPath>
<HintPath>..\packages\Winium.Cruciatus.2.9.1\lib\net45\Winium.Cruciatus.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Winium.Desktop.Driver/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" userInstalled="true" />
<package id="NLog" version="3.1.0.0" targetFramework="net451" />
<package id="Selenium.WebDriver" version="2.46.0" targetFramework="net451" userInstalled="true" />
<package id="Winium.Cruciatus" version="2.9.0" targetFramework="net451" />
<package id="Winium.Cruciatus" version="2.9.1" targetFramework="net451" />
</packages>

0 comments on commit 005e905

Please sign in to comment.