diff --git a/README.md b/README.md
index 0fdaaf3e..2bd58af1 100644
--- a/README.md
+++ b/README.md
@@ -7,29 +7,32 @@ This Github project provides
- samples
- issue tracking
-Videos discussing this project
+**Videos about WinAppDriver**
https://channel9.msdn.com/events/Build/2016/Panel-Engineering-Quality (With Jonathan Lipps!)
https://channel9.msdn.com/events/Build/2016/P499 (Includes demos)
-To vote on new features go to https://wpdev.uservoice.com/forums/110705-universal-windows-platform and enter a new feature request under the **UI Testing** category.
-
+## Vote on New Features
+Go to https://wpdev.uservoice.com/forums/110705-universal-windows-platform and enter requests under the **UI Testing** category.
## Getting Started
1. Download Windows Application Driver Installer here: http://download.microsoft.com/download/6/8/7/687DEE85-E907-4A95-8035-8BC969B9EA95/WindowsApplicationDriver.msi
2. Run the Installer on the machine where you will run your test in (the application under test should also be installed on this machine)
3. Browse to the Windows Application Driver installation directory and run `WinAppDriver.exe`
-4. Open any sample test solution (see the samples in this github project) with Visual Studio 2015 under https://github.com/Microsoft/WinAppDriver/tree/master/Samples.
For example, pull and open `CalculatorTest.sln` under [CalculatorTest](https://github.com/Microsoft/WinAppDriver/tree/master/Samples/CalculatorTest)
-5. In Visual Studio 2015 with the test solution open build the test and select **Test > Run > All Tests**
-
+
When running `WinAppDriver.exe` a console window is opened which logs the JSON Wire Protocol HTTP requests
> Default listening address is 127.0.0.1:4723. You can configure `WinAppDriver.exe` to listen to a different IP address and port if you run it as administrator.
+## C# Samples
+1. see Samples/C# in this github project. Open one of the test solutions with Visual Studio 2015. For example, pull and open `CalculatorTest.sln` under [CalculatorTest](https://github.com/Microsoft/WinAppDriver/tree/master/Samples/C%23/CalculatorTest)
+2. In Visual Studio 2015 with the test solution open build the test and select **Test > Run > All Tests**
+
+## Java Samples
+1. see Samples/Java in this github project. Open the sample folder as an existing project in a Java IDE such as IntelliJ. For example: [CalculatorTest](https://github.com/Microsoft/WinAppDriver/tree/master/Samples/Java/CalculatorTest)
+2. In the Java IDE build and run the test
## Features
-
-Windows Application Driver supports testing **Universal Windows Platform (UWP)** and **Classic Windows (Win32)** apps on **Windows 10 PC**.
-
+Windows Application Driver supports testing **Universal Windows Platform (UWP)** and **Classic Windows (Win32)** apps on **Windows 10 PC**
## Currently Supported API's
@@ -107,7 +110,6 @@ AlarmClockSession.FindElementByAccessibilityId("AlarmNameTextBox").Clear();
> When testing the application you authored yourself, you can find the **Application Id** in the generetated `AppX\vs.appxrecipe` file under `RegisteredUserNmodeAppID` node. E.g. ```c24c8163-548e-4b84-a466-530178fc0580_scyf5npe3hv32!App```
-
### Classic Windows App Testing
To test a classic Windows app, you can also use any Selenium supported language and specify the **full executable path** for the app under test in the **app** capabilities entry. Below is an example of creating a test session for Windows **Notepad** app:
diff --git a/Samples/.gitignore b/Samples/.gitignore
new file mode 100644
index 00000000..761d8c30
--- /dev/null
+++ b/Samples/.gitignore
@@ -0,0 +1,2 @@
+project.lock.json
+*.user
\ No newline at end of file
diff --git a/Samples/AlarmClockTest/AlarmClockTest.csproj b/Samples/C#/AlarmClockTest/AlarmClockTest.csproj
similarity index 100%
rename from Samples/AlarmClockTest/AlarmClockTest.csproj
rename to Samples/C#/AlarmClockTest/AlarmClockTest.csproj
diff --git a/Samples/AlarmClockTest/AlarmClockTest.sln b/Samples/C#/AlarmClockTest/AlarmClockTest.sln
similarity index 100%
rename from Samples/AlarmClockTest/AlarmClockTest.sln
rename to Samples/C#/AlarmClockTest/AlarmClockTest.sln
diff --git a/Samples/AlarmClockTest/Properties/AssemblyInfo.cs b/Samples/C#/AlarmClockTest/Properties/AssemblyInfo.cs
similarity index 100%
rename from Samples/AlarmClockTest/Properties/AssemblyInfo.cs
rename to Samples/C#/AlarmClockTest/Properties/AssemblyInfo.cs
diff --git a/Samples/AlarmClockTest/Scenario.cs b/Samples/C#/AlarmClockTest/Scenario.cs
similarity index 93%
rename from Samples/AlarmClockTest/Scenario.cs
rename to Samples/C#/AlarmClockTest/Scenario.cs
index a5b7e6cf..51692b2f 100644
--- a/Samples/AlarmClockTest/Scenario.cs
+++ b/Samples/C#/AlarmClockTest/Scenario.cs
@@ -106,10 +106,14 @@ public string ReadLocalTime()
localTimeText = worldClockPivotItem.FindElementByClassName("ClockCardItem").Text;
var timeStrings = localTimeText.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- if (timeStrings.Length >= 5)
+ foreach (string timeString in timeStrings)
{
- // Get the time. E.g. "Local time, Monday, February 22, 2016, 11:32 AM, "
- localTimeText = timeStrings[4];
+ // Get the time. E.g. "11:32 AM" from "Local time, Monday, February 22, 2016, 11:32 AM, "
+ if (timeString.Contains(":"))
+ {
+ localTimeText = timeString;
+ break;
+ }
}
}
@@ -121,9 +125,8 @@ public void AddAlarm(string timeText)
if (timeText.Length > 0)
{
// Create a test alarm 1 minute after the read local time
- string alarmTimeString = timeText;
- DateTimeFormatInfo fi = new CultureInfo("en-US", false).DateTimeFormat;
- DateTime alarmTime = DateTime.ParseExact(alarmTimeString, " h:mm tt", fi);
+ DateTimeFormatInfo fi = CultureInfo.CurrentUICulture.DateTimeFormat;
+ DateTime alarmTime = DateTime.Parse(timeText, fi);
alarmTime = alarmTime.AddMinutes(1.0);
string hourString = alarmTime.ToString("%h", fi);
string minuteString = alarmTime.ToString("mm", fi);
diff --git a/Samples/AlarmClockTest/packages.config b/Samples/C#/AlarmClockTest/packages.config
similarity index 100%
rename from Samples/AlarmClockTest/packages.config
rename to Samples/C#/AlarmClockTest/packages.config
diff --git a/Samples/C#/BaseConverterTest/BaseConverterTest.sln b/Samples/C#/BaseConverterTest/BaseConverterTest.sln
new file mode 100644
index 00000000..a63bb4f7
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterTest.sln
@@ -0,0 +1,62 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseConverterUWP", "BaseConverterUWP\BaseConverterUWP.csproj", "{8465E874-BFC7-4B8A-B9BB-E710DB67F520}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseConverterUITest", "BaseConverterUITest\BaseConverterUITest.csproj", "{8D72292F-6450-4AEE-91B5-4C34A225C9CE}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|ARM = Debug|ARM
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|ARM = Release|ARM
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|ARM.ActiveCfg = Debug|ARM
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|ARM.Build.0 = Debug|ARM
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|ARM.Deploy.0 = Debug|ARM
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x64.ActiveCfg = Debug|x64
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x64.Build.0 = Debug|x64
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x64.Deploy.0 = Debug|x64
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x86.ActiveCfg = Debug|x86
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x86.Build.0 = Debug|x86
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x86.Deploy.0 = Debug|x86
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|Any CPU.ActiveCfg = Release|x86
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|ARM.ActiveCfg = Release|ARM
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|ARM.Build.0 = Release|ARM
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|ARM.Deploy.0 = Release|ARM
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x64.ActiveCfg = Release|x64
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x64.Build.0 = Release|x64
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x64.Deploy.0 = Release|x64
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x86.ActiveCfg = Release|x86
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x86.Build.0 = Release|x86
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x86.Deploy.0 = Release|x86
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|ARM.Build.0 = Debug|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|x64.Build.0 = Debug|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|x86.Build.0 = Debug|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|ARM.ActiveCfg = Release|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|ARM.Build.0 = Release|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|x64.ActiveCfg = Release|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|x64.Build.0 = Release|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|x86.ActiveCfg = Release|Any CPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUITest/BaseConverterUITest.csproj b/Samples/C#/BaseConverterTest/BaseConverterUITest/BaseConverterUITest.csproj
new file mode 100644
index 00000000..2f84b3a8
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUITest/BaseConverterUITest.csproj
@@ -0,0 +1,91 @@
+
+
+
+ Debug
+ AnyCPU
+ {8D72292F-6450-4AEE-91B5-4C34A225C9CE}
+ Library
+ Properties
+ BaseConverterUITest
+ BaseConverterUITest
+ v4.5.2
+ 512
+ {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 10.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages
+ False
+ UnitTest
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+ ..\packages\Selenium.WebDriver.2.53.0\lib\net40\WebDriver.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUITest/Properties/AssemblyInfo.cs b/Samples/C#/BaseConverterTest/BaseConverterUITest/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..da7bab74
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUITest/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("BaseConverterUITest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("BaseConverterUITest")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("8d72292f-6450-4aee-91b5-4c34a225c9ce")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUITest/UnitTest1.cs b/Samples/C#/BaseConverterTest/BaseConverterUITest/UnitTest1.cs
new file mode 100644
index 00000000..86a716ac
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUITest/UnitTest1.cs
@@ -0,0 +1,71 @@
+//******************************************************************************
+//
+// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
+//
+// This code is licensed under the MIT License (MIT).
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//******************************************************************************
+
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using OpenQA.Selenium.Remote;
+
+namespace BaseConverterUITest
+{
+ [TestClass]
+ public class UnitTest1
+ {
+ protected const string AppDriverUrl = "http://127.0.0.1:4723";
+ protected static RemoteWebDriver TestAppSession;
+ protected static RemoteWebElement TestAppResult;
+
+ [ClassInitialize]
+ public static void Setup(TestContext context)
+ {
+ DesiredCapabilities appCapabilities = new DesiredCapabilities();
+ appCapabilities.SetCapability("app", "67017b09-d193-4676-a8a5-9d474e2f2c74_1gb0zh1xa1sqe!App");
+ TestAppSession = new RemoteWebDriver(new Uri(AppDriverUrl), appCapabilities);
+
+ Assert.IsNotNull(TestAppSession);
+ }
+ [TestMethod]
+ public void ConvertBaseTest()
+ {
+ var boxes = TestAppSession.FindElementsByClassName("TextBox");
+ for (int i = 0; i < boxes.Count; i++)
+ {
+ var item = boxes[i];
+ if (i == 0)
+ {
+ item.SendKeys("16");
+ }
+ else if (i == 1)
+ {
+ item.SendKeys("2");
+ }
+ else
+ {
+ //do nothing
+ }
+ }
+
+ var button = TestAppSession.FindElementByClassName("Button");
+ button.Click();
+
+ /*Verify the conversion happened successfully by locating the converted item on the page
+ *In this case, converting 16 from base 10 to base 2 should yield 10,000 as the result*/
+ TestAppResult = TestAppSession.FindElementByName("10000") as RemoteWebElement;
+ Assert.IsNotNull(TestAppResult);
+
+ TestAppSession.Dispose();
+ }
+ }
+}
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUITest/packages.config b/Samples/C#/BaseConverterTest/BaseConverterUITest/packages.config
new file mode 100644
index 00000000..86b5f26f
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUITest/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/App.xaml b/Samples/C#/BaseConverterTest/BaseConverterUWP/App.xaml
new file mode 100644
index 00000000..693f6c6d
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUWP/App.xaml
@@ -0,0 +1,8 @@
+
+
+
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/App.xaml.cs b/Samples/C#/BaseConverterTest/BaseConverterUWP/App.xaml.cs
new file mode 100644
index 00000000..d2a505d6
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUWP/App.xaml.cs
@@ -0,0 +1,121 @@
+//******************************************************************************
+//
+// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
+//
+// This code is licensed under the MIT License (MIT).
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//******************************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.ApplicationModel;
+using Windows.ApplicationModel.Activation;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+namespace BaseConverterUWP
+{
+ ///
+ /// Provides application-specific behavior to supplement the default Application class.
+ ///
+ sealed partial class App : Application
+ {
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
+ public App()
+ {
+ this.InitializeComponent();
+ this.Suspending += OnSuspending;
+ }
+
+ ///
+ /// Invoked when the application is launched normally by the end user. Other entry points
+ /// will be used such as when the application is launched to open a specific file.
+ ///
+ /// Details about the launch request and process.
+ protected override void OnLaunched(LaunchActivatedEventArgs e)
+ {
+
+#if DEBUG
+ if (System.Diagnostics.Debugger.IsAttached)
+ {
+ this.DebugSettings.EnableFrameRateCounter = true;
+ }
+#endif
+
+ Frame rootFrame = Window.Current.Content as Frame;
+
+ // Do not repeat app initialization when the Window already has content,
+ // just ensure that the window is active
+ if (rootFrame == null)
+ {
+ // Create a Frame to act as the navigation context and navigate to the first page
+ rootFrame = new Frame();
+
+ rootFrame.NavigationFailed += OnNavigationFailed;
+
+ if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
+ {
+ //TODO: Load state from previously suspended application
+ }
+
+ // Place the frame in the current Window
+ Window.Current.Content = rootFrame;
+ }
+
+ if (rootFrame.Content == null)
+ {
+ // When the navigation stack isn't restored navigate to the first page,
+ // configuring the new page by passing required information as a navigation
+ // parameter
+ rootFrame.Navigate(typeof(BaseConverterUWP.MainPage), e.Arguments);
+ }
+ // Ensure the current window is active
+ Window.Current.Activate();
+ }
+
+ ///
+ /// Invoked when Navigation to a certain page fails
+ ///
+ /// The Frame which failed navigation
+ /// Details about the navigation failure
+ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
+ {
+ throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
+ }
+
+ ///
+ /// Invoked when application execution is being suspended. Application state is saved
+ /// without knowing whether the application will be terminated or resumed with the contents
+ /// of memory still intact.
+ ///
+ /// The source of the suspend request.
+ /// Details about the suspend request.
+ private void OnSuspending(object sender, SuspendingEventArgs e)
+ {
+ var deferral = e.SuspendingOperation.GetDeferral();
+ //TODO: Save application state and stop any background activity
+ deferral.Complete();
+ }
+ }
+}
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/LockScreenLogo.scale-200.png b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/LockScreenLogo.scale-200.png
new file mode 100644
index 00000000..735f57ad
Binary files /dev/null and b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/LockScreenLogo.scale-200.png differ
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/SplashScreen.scale-200.png b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/SplashScreen.scale-200.png
new file mode 100644
index 00000000..023e7f1f
Binary files /dev/null and b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/SplashScreen.scale-200.png differ
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Square150x150Logo.scale-200.png b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Square150x150Logo.scale-200.png
new file mode 100644
index 00000000..af49fec1
Binary files /dev/null and b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Square150x150Logo.scale-200.png differ
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.scale-200.png b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.scale-200.png
new file mode 100644
index 00000000..ce342a2e
Binary files /dev/null and b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.scale-200.png differ
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
new file mode 100644
index 00000000..f6c02ce9
Binary files /dev/null and b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/StoreLogo.png b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/StoreLogo.png
new file mode 100644
index 00000000..7385b56c
Binary files /dev/null and b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/StoreLogo.png differ
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Wide310x150Logo.scale-200.png b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Wide310x150Logo.scale-200.png
new file mode 100644
index 00000000..288995b3
Binary files /dev/null and b/Samples/C#/BaseConverterTest/BaseConverterUWP/Assets/Wide310x150Logo.scale-200.png differ
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/BaseConverterUWP.csproj b/Samples/C#/BaseConverterTest/BaseConverterUWP/BaseConverterUWP.csproj
new file mode 100644
index 00000000..c2dd3eb6
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUWP/BaseConverterUWP.csproj
@@ -0,0 +1,141 @@
+
+
+
+
+ Debug
+ x86
+ {8465E874-BFC7-4B8A-B9BB-E710DB67F520}
+ AppContainerExe
+ Properties
+ BaseConverterUWP
+ BaseConverterUWP
+ en-US
+ UAP
+ 10.0.10586.0
+ 10.0.10240.0
+ 14
+ true
+ 512
+ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ BaseConverter_TemporaryKey.pfx
+
+
+ true
+ bin\ARM\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ ARM
+ false
+ prompt
+ true
+
+
+ bin\ARM\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ ARM
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x64
+ false
+ prompt
+ true
+
+
+ bin\x64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x64
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\x86\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x86
+ false
+ prompt
+ true
+
+
+ bin\x86\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x86
+ false
+ prompt
+ true
+ true
+
+
+
+
+
+
+
+ App.xaml
+
+
+ MainPage.xaml
+
+
+
+
+
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+ 14.0
+
+
+
+
\ No newline at end of file
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/BaseConverter_TemporaryKey.pfx b/Samples/C#/BaseConverterTest/BaseConverterUWP/BaseConverter_TemporaryKey.pfx
new file mode 100644
index 00000000..b5ae9576
Binary files /dev/null and b/Samples/C#/BaseConverterTest/BaseConverterUWP/BaseConverter_TemporaryKey.pfx differ
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/MainPage.xaml b/Samples/C#/BaseConverterTest/BaseConverterUWP/MainPage.xaml
new file mode 100644
index 00000000..13a3319b
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUWP/MainPage.xaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/MainPage.xaml.cs b/Samples/C#/BaseConverterTest/BaseConverterUWP/MainPage.xaml.cs
new file mode 100644
index 00000000..e42b858e
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUWP/MainPage.xaml.cs
@@ -0,0 +1,93 @@
+//******************************************************************************
+//
+// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
+//
+// This code is licensed under the MIT License (MIT).
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//******************************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
+
+namespace BaseConverterUWP
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class MainPage : Page
+ {
+ private static char[] binary = { '0', '1' };
+
+ private static char[] hex = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ 'A', 'B', 'C', 'D', 'E', 'F'};
+
+ public MainPage()
+ {
+ this.InitializeComponent();
+ }
+
+ public static string converter(int value, string outbase)
+ {
+ var retval = "";
+ switch (outbase)
+ {
+ case "2":
+ retval = IntToString(value, binary);
+ break;
+ case "16":
+ retval = IntToString(value, hex);
+ break;
+ default:
+ retval = value.ToString();
+ break;
+ }
+ return retval;
+ }
+
+ public static string IntToString(int value, char[] baseChars)
+ {
+ string result = string.Empty;
+ int targetBase = baseChars.Length;
+
+ do
+ {
+ result = baseChars[value % targetBase] + result;
+ value = value / targetBase;
+ }
+ while (value > 0);
+
+ return result;
+ }
+
+ private void mainButton_Click(object sender, RoutedEventArgs e)
+ {
+ //grab the input number, output base, and convert using the shared code in App1
+ var inputNumber = inputNumberTextBox.Text;
+ string outBase = outBaseTextBox.Text;
+ var finalNumber = converter(int.Parse(inputNumber), outBase);
+ finalNumberTextBox.Text = finalNumber;
+ }
+ }
+}
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/Package.appxmanifest b/Samples/C#/BaseConverterTest/BaseConverterUWP/Package.appxmanifest
new file mode 100644
index 00000000..71aa7cf4
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUWP/Package.appxmanifest
@@ -0,0 +1,28 @@
+
+
+
+
+
+ BaseConverterUWP
+ anlak
+ Assets\StoreLogo.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/Properties/AssemblyInfo.cs b/Samples/C#/BaseConverterTest/BaseConverterUWP/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..736f336e
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUWP/Properties/AssemblyInfo.cs
@@ -0,0 +1,29 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("BaseConverterUWP")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("BaseConverterUWP")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/Properties/Default.rd.xml b/Samples/C#/BaseConverterTest/BaseConverterUWP/Properties/Default.rd.xml
new file mode 100644
index 00000000..80a960ce
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUWP/Properties/Default.rd.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/C#/BaseConverterTest/BaseConverterUWP/project.json b/Samples/C#/BaseConverterTest/BaseConverterUWP/project.json
new file mode 100644
index 00000000..e3b2dba2
--- /dev/null
+++ b/Samples/C#/BaseConverterTest/BaseConverterUWP/project.json
@@ -0,0 +1,19 @@
+{
+ "dependencies": {
+ "Microsoft.ApplicationInsights": "1.0.0",
+ "Microsoft.ApplicationInsights.PersistenceChannel": "1.0.0",
+ "Microsoft.ApplicationInsights.WindowsApps": "1.0.0",
+ "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
+ },
+ "frameworks": {
+ "uap10.0": {}
+ },
+ "runtimes": {
+ "win10-arm": {},
+ "win10-arm-aot": {},
+ "win10-x86": {},
+ "win10-x86-aot": {},
+ "win10-x64": {},
+ "win10-x64-aot": {}
+ }
+}
\ No newline at end of file
diff --git a/Samples/CalculatorTest/BasicScenarios.cs b/Samples/C#/CalculatorTest/BasicScenarios.cs
similarity index 98%
rename from Samples/CalculatorTest/BasicScenarios.cs
rename to Samples/C#/CalculatorTest/BasicScenarios.cs
index e0407868..45fd6a33 100644
--- a/Samples/CalculatorTest/BasicScenarios.cs
+++ b/Samples/C#/CalculatorTest/BasicScenarios.cs
@@ -79,6 +79,7 @@ public void Combination()
CalculatorSession.FindElementByName("Nine").Click();
CalculatorSession.FindElementByName("Plus").Click();
CalculatorSession.FindElementByName("One").Click();
+ CalculatorSession.FindElementByName("Equals").Click();
CalculatorSession.FindElementByName("Divide by").Click();
CalculatorSession.FindElementByName("Eight").Click();
CalculatorSession.FindElementByName("Equals").Click();
diff --git a/Samples/CalculatorTest/CalculatorTest.csproj b/Samples/C#/CalculatorTest/CalculatorTest.csproj
similarity index 100%
rename from Samples/CalculatorTest/CalculatorTest.csproj
rename to Samples/C#/CalculatorTest/CalculatorTest.csproj
diff --git a/Samples/CalculatorTest/CalculatorTest.sln b/Samples/C#/CalculatorTest/CalculatorTest.sln
similarity index 100%
rename from Samples/CalculatorTest/CalculatorTest.sln
rename to Samples/C#/CalculatorTest/CalculatorTest.sln
diff --git a/Samples/CalculatorTest/Properties/AssemblyInfo.cs b/Samples/C#/CalculatorTest/Properties/AssemblyInfo.cs
similarity index 100%
rename from Samples/CalculatorTest/Properties/AssemblyInfo.cs
rename to Samples/C#/CalculatorTest/Properties/AssemblyInfo.cs
diff --git a/Samples/CalculatorTest/app.config b/Samples/C#/CalculatorTest/app.config
similarity index 100%
rename from Samples/CalculatorTest/app.config
rename to Samples/C#/CalculatorTest/app.config
diff --git a/Samples/CalculatorTest/packages.config b/Samples/C#/CalculatorTest/packages.config
similarity index 70%
rename from Samples/CalculatorTest/packages.config
rename to Samples/C#/CalculatorTest/packages.config
index d4dee4a9..2344d715 100644
--- a/Samples/CalculatorTest/packages.config
+++ b/Samples/C#/CalculatorTest/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/Samples/CortanaTest/CortanaTest.csproj b/Samples/C#/CortanaTest/CortanaTest.csproj
similarity index 100%
rename from Samples/CortanaTest/CortanaTest.csproj
rename to Samples/C#/CortanaTest/CortanaTest.csproj
diff --git a/Samples/CortanaTest/CortanaTest.sln b/Samples/C#/CortanaTest/CortanaTest.sln
similarity index 100%
rename from Samples/CortanaTest/CortanaTest.sln
rename to Samples/C#/CortanaTest/CortanaTest.sln
diff --git a/Samples/CortanaTest/Properties/AssemblyInfo.cs b/Samples/C#/CortanaTest/Properties/AssemblyInfo.cs
similarity index 100%
rename from Samples/CortanaTest/Properties/AssemblyInfo.cs
rename to Samples/C#/CortanaTest/Properties/AssemblyInfo.cs
diff --git a/Samples/CortanaTest/Scenario.cs b/Samples/C#/CortanaTest/Scenario.cs
similarity index 100%
rename from Samples/CortanaTest/Scenario.cs
rename to Samples/C#/CortanaTest/Scenario.cs
diff --git a/Samples/CortanaTest/packages.config b/Samples/C#/CortanaTest/packages.config
similarity index 100%
rename from Samples/CortanaTest/packages.config
rename to Samples/C#/CortanaTest/packages.config
diff --git a/Samples/Java/CalculatorTest/pom.xml b/Samples/Java/CalculatorTest/pom.xml
new file mode 100644
index 00000000..110f2465
--- /dev/null
+++ b/Samples/Java/CalculatorTest/pom.xml
@@ -0,0 +1,29 @@
+
+
+ 4.0.0
+
+ CalculatorTest
+ CalculatorTest
+ 1.0-SNAPSHOT
+
+
+
+ org.seleniumhq.selenium
+ selenium-java
+ 2.53.0
+
+
+ junit
+ junit
+ 4.11
+
+
+ io.appium
+ java-client
+ 3.4.1
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Java/CalculatorTest/src/test/java/CalculatorTest.java b/Samples/Java/CalculatorTest/src/test/java/CalculatorTest.java
new file mode 100644
index 00000000..3ad659ca
--- /dev/null
+++ b/Samples/Java/CalculatorTest/src/test/java/CalculatorTest.java
@@ -0,0 +1,121 @@
+//******************************************************************************
+//
+// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
+//
+// This code is licensed under the MIT License (MIT).
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//******************************************************************************
+
+import org.junit.*;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.remote.DesiredCapabilities;
+import java.util.concurrent.TimeUnit;
+import java.net.URL;
+import io.appium.java_client.ios.IOSDriver;
+
+public class CalculatorTest {
+
+ private static IOSDriver CalculatorSession = null;
+ private static WebElement CalculatorResult = null;
+
+ @BeforeClass
+ public static void setup() {
+ try {
+ DesiredCapabilities capabilities = new DesiredCapabilities();
+ capabilities.setCapability("app", "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
+ CalculatorSession = new IOSDriver(new URL("http://127.0.0.1:4723"), capabilities);
+ CalculatorSession.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
+
+ CalculatorSession.findElementByName("Clear").click();
+ CalculatorSession.findElementByName("Seven").click();
+ CalculatorResult = CalculatorSession.findElementByName("Display is 7 ");
+ Assert.assertNotNull(CalculatorResult);
+
+ }catch(Exception e){
+ e.printStackTrace();
+ } finally {
+ }
+ }
+
+ @Before
+ public void Clear()
+ {
+ CalculatorSession.findElementByName("Clear").click();
+ Assert.assertEquals("Display is 0 ", CalculatorResult.getText());
+ }
+
+ @AfterClass
+ public static void TearDown()
+ {
+ CalculatorResult = null;
+ if (CalculatorSession != null) {
+ CalculatorSession.quit();
+ }
+ CalculatorSession = null;
+ }
+
+ @Test
+ public void Addition()
+ {
+ CalculatorSession.findElementByName("One").click();
+ CalculatorSession.findElementByName("Plus").click();
+ CalculatorSession.findElementByName("Seven").click();
+ CalculatorSession.findElementByName("Equals").click();
+ Assert.assertEquals("Display is 8 ", CalculatorResult.getText());
+ }
+
+ @Test
+ public void Combination()
+ {
+ CalculatorSession.findElementByName("Seven").click();
+ CalculatorSession.findElementByName("Multiply by").click();
+ CalculatorSession.findElementByName("Nine").click();
+ CalculatorSession.findElementByName("Plus").click();
+ CalculatorSession.findElementByName("One").click();
+ CalculatorSession.findElementByName("Equals").click();
+ CalculatorSession.findElementByName("Divide by").click();
+ CalculatorSession.findElementByName("Eight").click();
+ CalculatorSession.findElementByName("Equals").click();
+ Assert.assertEquals("Display is 8 ", CalculatorResult.getText());
+ }
+
+ @Test
+ public void Division()
+ {
+ CalculatorSession.findElementByName("Eight").click();
+ CalculatorSession.findElementByName("Eight").click();
+ CalculatorSession.findElementByName("Divide by").click();
+ CalculatorSession.findElementByName("One").click();
+ CalculatorSession.findElementByName("One").click();
+ CalculatorSession.findElementByName("Equals").click();
+ Assert.assertEquals("Display is 8 ", CalculatorResult.getText());
+ }
+
+ @Test
+ public void Multiplication()
+ {
+ CalculatorSession.findElementByName("Nine").click();
+ CalculatorSession.findElementByName("Multiply by").click();
+ CalculatorSession.findElementByName("Nine").click();
+ CalculatorSession.findElementByName("Equals").click();
+ Assert.assertEquals("Display is 81 ", CalculatorResult.getText());
+ }
+
+ @Test
+ public void Subtraction()
+ {
+ CalculatorSession.findElementByName("Nine").click();
+ CalculatorSession.findElementByName("Minus").click();
+ CalculatorSession.findElementByName("One").click();
+ CalculatorSession.findElementByName("Equals").click();
+ Assert.assertEquals("Display is 8 ", CalculatorResult.getText());
+ }
+}