Windows Phone 8 应用程序中的 UI 自动化 [英] UI automation in windows phone 8 application

查看:22
本文介绍了Windows Phone 8 应用程序中的 UI 自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 windows phone 8 应用程序中搜索了自动化 UI,但我没有得到任何有用的工具或框架,那么是否有任何框架可以在 windows phone 8 中自动执行 UI 应用程序?

i have searched for automating UI in windows phone 8 applications and i did not get any useful tool or framework for that so is there any framework to automate UI application in windows phone 8?

推荐答案

您可以使用 Winium.

You can use Winium.

为什么是 Winium?

Why Winium?

  • 你有 Selenium WebDriver 来测试 Web 应用程序,Appium 用于
    测试 iOS 和 Android 应用程序.现在你有了基于硒的
    用于测试 Windows 应用程序的工具.有哪些好处?正如 Appium 所说:

    You have Selenium WebDriver for testing of web apps, Appium for
    testing of iOS and Android apps. And now you have Selenium-based
    tools for testing of Windows apps too. What are some of the benefits? As said by Appium:

  • 您可以使用自己喜欢的开发工具编写测试WebDriver 兼容语言,例如 Java、Objective-C、JavaScript使用 Node.js(承诺、回调或生成器风格)、PHP、Python、Ruby、C#、Clojure 或带有 Selenium WebDriver API 的 Perl 和特定于语言的客户端库.

    You can write tests with your favorite dev tools using any WebDriver-compatible language such as Java, Objective-C, JavaScript with Node.js (in promise, callback or generator flavors), PHP, Python, Ruby, C#, Clojure, or Perl with the Selenium WebDriver API and language-specific client libraries.

  • 您可以使用任何测试框架.

    You can use any testing framework.

  • 它是如何工作的?

    Winium.StoreApps 由两个基本部分组成:

    Winium.StoreApps consists of two essential parts:

    Winium.StoreApps.Driver 实现 Selenium Remote WebDriver 和侦听 JsonWireProtocol 命令.它负责启动模拟器,部署 AUT,模拟输入,将命令转发到Winium.StoreApps.InnerServer 等

    Winium.StoreApps.Driver implements Selenium Remote WebDriver and listens for JsonWireProtocol commands. It is responsible for launching emulator, deploying AUT, simulating input, forwarding commands to Winium.StoreApps.InnerServer, etc.

  • Winium.StoreApps.InnerServer(应该嵌入到AUT) 与 Winium.StoreApps.Driver.exe 通信并执行不同的命令,例如查找元素、获取或设置文本应用程序中的值、属性等.

    Winium.StoreApps.InnerServer (the one that should be embedded into AUT) communicates with Winium.StoreApps.Driver.exe and executes different commands, like finding elements, getting or setting text values, properties, etc., inside your application.

  • 测试样本:

    Python

    # 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()
    
    Please check the link below. It can help you a lot.
    
    You just have to follow guidance in this project.
    

    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();
      }
    }
    

    Winium.StoreApps

    我目前正在使用这个开源软件开发 Windows Phone 自动化

    I am currently working on a Windows Phone Automation using this opensource

    项目,它对我来说效果很好.

    project, it works pretty well for me.

    这篇关于Windows Phone 8 应用程序中的 UI 自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆