本文介绍了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?
它是如何工作的?
Winium.StoreApps 由两个基本部分组成:
Winium.StoreApps consists of two essential parts:
测试样本:
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();
}
}
我目前正在使用这个开源软件开发 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 自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!