Skip to content

Commit

Permalink
Merge pull request #19 from ObjectivityBSS/selenium3
Browse files Browse the repository at this point in the history
Selenium3
  • Loading branch information
raczeja authored Nov 10, 2016
2 parents 1f1c680 + 923180a commit 2709b1c
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- The configuration and platform will be used to determine which assemblies to include from solution and
project documentation sources -->
Expand Down Expand Up @@ -51,7 +51,7 @@
<HeaderText>Framework to automate tests using Selenium WebDriver</HeaderText>
<FeedbackEMailAddress>TestAutomationGroup%40objectivity.co.uk</FeedbackEMailAddress>
<CopyrightHref>http://www.objectivity.co.uk/</CopyrightHref>
<HtmlHelp1xCompilerPath>..\packages\EWSoftware.SHFB.2016.4.9.0\tools\</HtmlHelp1xCompilerPath>
<HtmlHelp1xCompilerPath>..\packages\EWSoftware.SHFB.2016.9.17.0\tools\</HtmlHelp1xCompilerPath>
<ComponentPath>..\packages\</ComponentPath>
<MissingTags>Summary, Parameter, Returns, AutoDocumentCtors, TypeParameter, AutoDocumentDispose</MissingTags>
<PlugInConfigurations>
Expand All @@ -69,10 +69,12 @@
</Filter>
</ApiFilter>
<VisibleItems>InheritedMembers, InheritedFrameworkMembers, Protected, ProtectedInternalAsProtected</VisibleItems>
<WarnOnMissingSourceContext>False</WarnOnMissingSourceContext>
<SourceCodeBasePath>..\Objectivity.Test.Automation.Common\</SourceCodeBasePath>
</PropertyGroup>
<PropertyGroup>
<!-- NOTE: Update the version number in the path (YYYY.M.D.R) to match the package version -->
<SHFBROOT Condition=" '$(SHFBROOT)' == '' ">$(MSBuildThisFileDirectory)..\packages\EWSoftware.SHFB.2016.4.9.0\tools\</SHFBROOT>
<SHFBROOT Condition=" '$(SHFBROOT)' == '' ">$(MSBuildThisFileDirectory)..\packages\EWSoftware.SHFB.2016.9.17.0\tools\</SHFBROOT>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform
the build. The others are optional common platform types that may appear. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- The configuration and platform will be used to determine which assemblies to include from solution and
project documentation sources -->
Expand Down Expand Up @@ -27,10 +27,10 @@
<Argument Key="maxVersionParts" Value="" xmlns="" />
</TransformComponentArguments>
<DocumentationSources>
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.2.53.1\lib\net40\WebDriver.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.2.53.1\lib\net40\WebDriver.xml" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.2.53.1\lib\net40\WebDriver.Support.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.2.53.1\lib\net40\WebDriver.Support.xml" /></DocumentationSources>
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.3.0.0\lib\net40\WebDriver.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.3.0.0\lib\net40\WebDriver.xml" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.3.0.0\lib\net40\WebDriver.Support.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.3.0.0\lib\net40\WebDriver.Support.xml" /></DocumentationSources>
<SaveComponentCacheCapacity>100</SaveComponentCacheCapacity>
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
<HelpFileFormat>Website</HelpFileFormat>
Expand All @@ -53,13 +53,14 @@
<HeaderText>Framework to automate tests using Selenium WebDriver</HeaderText>
<FeedbackEMailAddress>TestAutomationGroup%40objectivity.co.uk</FeedbackEMailAddress>
<CopyrightHref>http://www.objectivity.co.uk/</CopyrightHref>
<HtmlHelp1xCompilerPath>..\packages\EWSoftware.SHFB.2016.4.9.0\tools\</HtmlHelp1xCompilerPath>
<HtmlHelp1xCompilerPath>..\packages\EWSoftware.SHFB.2016.9.17.0\tools\</HtmlHelp1xCompilerPath>
<ComponentPath>..\packages\</ComponentPath>
<MissingTags>Summary, Parameter, Returns, AutoDocumentCtors, TypeParameter, AutoDocumentDispose</MissingTags>
<WarnOnMissingSourceContext>True</WarnOnMissingSourceContext>
</PropertyGroup>
<PropertyGroup>
<!-- NOTE: Update the version number in the path (YYYY.M.D.R) to match the package version -->
<SHFBROOT Condition=" '$(SHFBROOT)' == '' ">$(MSBuildThisFileDirectory)..\packages\EWSoftware.SHFB.2016.4.9.0\tools\</SHFBROOT>
<SHFBROOT Condition=" '$(SHFBROOT)' == '' ">$(MSBuildThisFileDirectory)..\packages\EWSoftware.SHFB.2016.9.17.0\tools\</SHFBROOT>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform
the build. The others are optional common platform types that may appear. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EWSoftware.SHFB" version="2016.4.9.0" targetFramework="net40" />
<package id="EWSoftware.SHFB" version="2016.9.17.0" targetFramework="net40" />
<package id="EWSoftware.SHFB.NETFramework" version="4.6" targetFramework="net40" />
</packages>
1 change: 1 addition & 0 deletions Objectivity.Test.Automation.Common/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<!--<add key="browser" value="Safari" />-->
<!--<add key="browser" value="PhantomJs" />-->
<add key="browser" value="Firefox" />
<add key="FirefoxUseLegacyImplementation" value="true" />
<add key="FireFoxPath" value="\..\..\..\FirefoxPortable\FirefoxPortable.exe" />
<add key="PhantomJsPath" value="\..\..\..\packages\PhantomJS.2.1.1\tools\phantomjs\" />
<!--<add key="proxy" value="127.0.0.1:9999" />-->
Expand Down
22 changes: 22 additions & 0 deletions Objectivity.Test.Automation.Common/BaseConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,28 @@ public static bool FullDesktopScreenShotEnabled
}
}

/// <summary>
/// Gets a value indicating whether enable legacy implementation for Firefox.
/// </summary>
public static bool FirefoxUseLegacyImplementation
{
get
{
Logger.Trace(CultureInfo.CurrentCulture, "Firefox Use Legacy Implementation Enabled value from App.config '{0}'", ConfigurationManager.AppSettings["FirefoxUseLegacyImplementation"]);
if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["FirefoxUseLegacyImplementation"]))
{
return false;
}

if (ConfigurationManager.AppSettings["FirefoxUseLegacyImplementation"].ToLower(CultureInfo.CurrentCulture).Equals("true"))
{
return true;
}

return false;
}
}

/// <summary>
/// Gets a value indicating whether use firefox profile. False by default.
/// </summary>
Expand Down
8 changes: 4 additions & 4 deletions Objectivity.Test.Automation.Common/DriverContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,12 @@ public void Start()
switch (BaseConfiguration.TestBrowser)
{
case BrowserType.Firefox:
this.driver = new FirefoxDriver(new FirefoxBinary(), this.FirefoxProfile, TimeSpan.FromSeconds(BaseConfiguration.LongTimeout));
var fireFoxOptionsLegacy = new FirefoxOptions { Profile = this.FirefoxProfile, UseLegacyImplementation = BaseConfiguration.FirefoxUseLegacyImplementation };
this.driver = new FirefoxDriver(fireFoxOptionsLegacy);
break;
case BrowserType.FirefoxPortable:
var profile = this.FirefoxProfile;
var firefoxBinary = new FirefoxBinary(BaseConfiguration.FirefoxPath);
this.driver = new FirefoxDriver(firefoxBinary, profile, TimeSpan.FromSeconds(BaseConfiguration.LongTimeout));
var fireFoxOptions = new FirefoxOptions { BrowserExecutableLocation = BaseConfiguration.FirefoxPath, Profile = this.FirefoxProfile, UseLegacyImplementation = BaseConfiguration.FirefoxUseLegacyImplementation };
this.driver = new FirefoxDriver(fireFoxOptions);
break;
case BrowserType.InternetExplorer:
this.driver = new InternetExplorerDriver(this.InternetExplorerProfile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<Reference Include="System.Xml.Linq" />
<Reference Include="WebDriver, Version=2.53.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.2.53.1\lib\net40\WebDriver.dll</HintPath>
<Reference Include="WebDriver, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.3.0.0\lib\net40\WebDriver.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="WebDriver.Support, Version=2.53.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.Support.2.53.1\lib\net40\WebDriver.Support.dll</HintPath>
<Reference Include="WebDriver.Support, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.Support.3.0.0\lib\net40\WebDriver.Support.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand Down Expand Up @@ -173,7 +173,11 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\build\Selenium.WebDriver.ChromeDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\build\Selenium.WebDriver.ChromeDriver.targets'))" />
</Target>
<Import Project="..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets" Condition="Exists('..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets')" />
<Import Project="..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\build\Selenium.WebDriver.ChromeDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\build\Selenium.WebDriver.ChromeDriver.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
9 changes: 5 additions & 4 deletions Objectivity.Test.Automation.Common/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<package id="NLog" version="4.3.5" targetFramework="net40" />
<package id="NLog.Schema" version="4.3.4" targetFramework="net40" />
<package id="PhantomJS" version="2.1.1" targetFramework="net40" />
<package id="Selenium.Support" version="2.53.1" targetFramework="net40" />
<package id="Selenium.WebDriver" version="2.53.1" targetFramework="net40" />
<package id="Selenium.WebDriver.ChromeDriver" version="2.22.0.0" targetFramework="net40" />
<package id="Selenium.WebDriver.IEDriver" version="2.53.0.0" targetFramework="net40" />
<package id="Selenium.Firefox.WebDriver" version="0.11.1" targetFramework="net40" />
<package id="Selenium.Support" version="3.0.0" targetFramework="net40" />
<package id="Selenium.WebDriver" version="3.0.0" targetFramework="net40" />
<package id="Selenium.WebDriver.ChromeDriver" version="2.25.0.0" targetFramework="net40" />
<package id="Selenium.WebDriver.IEDriver" version="3.0.0.0" targetFramework="net40" />
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net40" developmentDependency="true" />
</packages>
1 change: 1 addition & 0 deletions Objectivity.Test.Automation.Tests.Features/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<!--<add key="browser" value="FirefoxPortable" />-->
<!--<add key="browser" value="PhantomJs" />-->
<add key="browser" value="Chrome" />
<add key="FirefoxUseLegacyImplementation" value="true" />
<add key="FireFoxPath" value="\..\..\..\FirefoxPortable\FirefoxPortable.exe" />
<add key="PhantomJsPath" value="\..\..\..\packages\PhantomJS.2.1.1\tools\phantomjs\" />
<!--<add key="proxy" value="127.0.0.1:9999" />-->
Expand Down
1 change: 1 addition & 0 deletions Objectivity.Test.Automation.Tests.MsTest/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<!--<add key="browser" value="FirefoxPortable" />-->
<!--<add key="browser" value="PhantomJs" />-->
<add key="browser" value="InternetExplorer" />
<add key="FirefoxUseLegacyImplementation" value="true" />
<add key="FireFoxPath" value="\..\..\..\FirefoxPortable\FirefoxPortable.exe" />
<add key="PhantomJsPath" value="\..\..\..\packages\PhantomJS.2.1.1\tools\phantomjs\" />
<!--<add key="proxy" value="127.0.0.1:9999" />-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="WebDriver, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.3.0.0\lib\net40\WebDriver.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
1 change: 1 addition & 0 deletions Objectivity.Test.Automation.Tests.MsTest/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<packages>
<package id="NLog" version="4.3.5" targetFramework="net40" />
<package id="NLog.Schema" version="4.3.4" targetFramework="net40" />
<package id="Selenium.WebDriver" version="3.0.0" targetFramework="net40" />
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net40" developmentDependency="true" />
</packages>
1 change: 1 addition & 0 deletions Objectivity.Test.Automation.Tests.NUnit/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<!--<add key="browser" value="FirefoxPortable" />-->
<!--<add key="browser" value="PhantomJs" />-->
<add key="browser" value="Firefox" />
<add key="FirefoxUseLegacyImplementation" value="true" />
<add key="FireFoxPath" value="\..\..\..\FirefoxPortable\FirefoxPortable.exe" />
<add key="PhantomJsPath" value="\..\..\..\packages\PhantomJS.2.1.1\tools\phantomjs\" />
<!--<add key="proxy" value="127.0.0.1:9999" />-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="WebDriver, Version=2.53.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.2.53.1\lib\net40\WebDriver.dll</HintPath>
<Reference Include="WebDriver, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.3.0.0\lib\net40\WebDriver.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="WebDriver.Support, Version=2.53.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.Support.2.53.1\lib\net40\WebDriver.Support.dll</HintPath>
<Reference Include="WebDriver.Support, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.Support.3.0.0\lib\net40\WebDriver.Support.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand Down Expand Up @@ -121,12 +121,16 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="..\packages\Selenium.WebDriver.IEDriver.3.0.0.0\driver\IEDriverServer.exe">
<Link>IEDriverServer.exe</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Selenium.Firefox.WebDriver.0.11.1\driver\geckodriver.exe">
<Link>geckodriver.exe</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\driver\chromedriver.exe">
<Link>chromedriver.exe</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Selenium.WebDriver.IEDriver.2.53.0.0\driver\IEDriverServer.exe">
<Link>IEDriverServer.exe</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
Expand All @@ -142,8 +146,10 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\build\Selenium.WebDriver.ChromeDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\build\Selenium.WebDriver.ChromeDriver.targets'))" />
</Target>
<Import Project="..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets" Condition="Exists('..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets')" />
<Import Project="..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\build\Selenium.WebDriver.ChromeDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\build\Selenium.WebDriver.ChromeDriver.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,8 @@ public void EnterUserName(string userName)
public void LogOn()
{
Logger.Info(CultureInfo.CurrentCulture, "Click on Login Button");
//// workaround problem with IE test
try
{
this.Driver.GetElement(this.loginButton).Click();
}
catch (UnhandledAlertException)
{
Logger.Debug(CultureInfo.CurrentCulture, "catching UnhandledAlertException, Workaround problem with IE test");
this.Driver.SwitchTo().Alert().Accept();
this.Driver.GetElement(this.loginButton).Click();
}

this.Driver.GetElement(this.loginButton).JavaScriptClick();
}
}
}
7 changes: 4 additions & 3 deletions Objectivity.Test.Automation.Tests.PageObjects/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<packages>
<package id="NLog" version="4.3.5" targetFramework="net40" />
<package id="NLog.Schema" version="4.3.4" targetFramework="net40" />
<package id="Selenium.Support" version="2.53.1" targetFramework="net40" />
<package id="Selenium.WebDriver" version="2.53.1" targetFramework="net40" />
<package id="Selenium.Firefox.WebDriver" version="0.11.1" targetFramework="net40" />
<package id="Selenium.Support" version="3.0.0" targetFramework="net40" />
<package id="Selenium.WebDriver" version="3.0.0" targetFramework="net40" />
<package id="Selenium.WebDriver.ChromeDriver" version="2.25.0.0" targetFramework="net40" />
<package id="Selenium.WebDriver.IEDriver" version="2.53.0.0" targetFramework="net40" />
<package id="Selenium.WebDriver.IEDriver" version="3.0.0.0" targetFramework="net40" />
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net40" developmentDependency="true" />
</packages>
Loading

0 comments on commit 2709b1c

Please sign in to comment.