我在windows phone 8应用程序中搜索了自动化UI,但我没有得到任何有用的工具或框架,那么在windows phone 8中有没有框架可以自动化UI应用程序?
发布于 2016-03-15 15:21:40
您可以使用Winium。
为什么选择Winium?
测试iOS和安卓应用程序。现在你有了基于硒的
测试Windows应用程序的工具。有哪些好处?正如Appium所说:
它是如何工作的?
Winium.StoreApps由两个基本部分组成:
在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();
}
}我目前正在使用这个开源软件开发Windows Phone自动化
项目,它对我来说工作得很好。
发布于 2013-05-15 08:53:05
看看这个项目:http://code.msdn.microsoft.com/wpapps/Simple-UI-Test-for-Windows-dc0573a9
它展示了如何模拟单击一个按钮并检索另一个元素的值。
我自己还没有尝试过,但原理似乎是:
创建单独的测试项目
在测试初始化代码中,实例化应用程序项目中的页面:
public void Init()
{
mp1 = new PhoneApp1.MainPage();
} 您的测试通过引用该实例化的页面来查找元素:
[TestMethod]
[Description("Test1: Clicking button passes")]
public void PassedTest()
{
var b = mp1.FindName("button1") as Button;
ButtonAutomationPeer peer = new ButtonAutomationPeer(b);
IInvokeProvider invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
invokeProv.Invoke();
Assert.AreEqual((mp1.FindName("AppTitle") as TextBlock).Text.ToString(), "Results");
}发布于 2015-01-21 21:01:42
我目前正在研究CodedUI测试,因为它们可能是解决方案。以下是微软应用程序生命周期管理博客的官方声明:http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/05/using-coded-ui-to-test-xaml-based-windows-phone-apps.aspx
文章中有一些非常具体的细节,我想强调一下:
当前不支持用于在XAML应用程序中承载
内容的WebView控件。
您还可以与外壳控件进行交互-这些控件不是XAML,但对于测试应用程序E2E是必不可少的-例如磁贴、确认对话框等。这些控件由操作系统提供,不是XAML。
仅支持基于XAML的商店应用程序。基于Silverlight和HTML5的应用程序无法使用编码的UI进行测试。
每当我在Windows phone8应用程序上使用CodedUI时,我都会更新我的回复-我需要自己编写测试并在实际的设备上运行它们。
https://stackoverflow.com/questions/16544730
复制相似问题