Skip to content
Gleb Golovin edited this page Mar 17, 2015 · 5 revisions

This article is a stub. Please help us improve it.

  • Run Winium.StoreApps.Driver.exe --verbose

Python

  • Write your test.py
# coding: utf-8
import unittest

from selenium.webdriver import Remote


class TestMainPage(unittest.TestCase):
    desired_capabilities = {
        "app": "C:\\YorAppUnderTest.appx"
    }

    def setUp(self):
        self.driver = Remote(command_executor="http://localhost:9999",
                             desired_capabilities=self.desired_capabilities)

    def test_button_tap_should_set_textbox_content(self):
        self.driver.find_element_by_id('SetButton').click()
        assert 'CARAMBA' == self.driver.find_element_by_id('MyTextBox').text

    def tearDown(self):
        self.driver.quit()


if __name__ == '__main__':
    unittest.main()
  • Run tests python test.py

C#

using System;
using NUnit.Framework;
using OpenQA.Selenium.Remote;

[TestFixture]
public class TestMainPage
{
    public RemoteWebDriver Driver { get; set; }

    [SetUp]
    public void SetUp()
    {
        var dc = new DesiredCapabilities();
        dc.SetCapability("app", "C:\\YorAppUnderTest.appx");
        this.Driver = new RemoteWebDriver(new Uri("http://localhost:9999"), dc);
    }

    [Test]
    public void TestButtonTapShouldSetTextboxContent()
    {
        this.Driver.FindElementById("SetButton").Click();
        Assert.IsTrue("CARAMBA" == this.Driver.FindElementById("MyTextBox").Text);
    }

    [TearDown]
    public void TearDown()
    {
        this.Driver.Quit();
    }
}