在Visual Studio 2010 beta中,使用CodedUI测试模板为我的Web应用程序记录了一些测试场景.它们在Visual Studio中成功运行,没有任何问题.我一直在寻找创建部署包的说明.
是否可以在另一个窗口内运行 Windows 应用程序(打开顶级窗口)?或者设置一个拥有该窗口的备用“桌面”/假桌面?
我正在使用 UI 自动化来自动化应用程序进行测试。我想将正在测试的应用程序放在一种沙箱中:桌面和应用程序之间的人工父窗口,或伪桌面,第二个桌面等。此桌面(以及正在测试的应用程序)不需要可见。
被测应用程序的不同实例(在普通桌面上或沙箱中)不应相互冲突(窗口名称/类明智)——被测应用程序可以安全地拥有多个实例...
我意识到这看起来有些 hackish,所以 win32 hacks 会受到欢迎。:)
我认为这是第一次 - 我收到一个错误,当我在Google上搜索它时,我收到的异常常数没有返回任何内容.
基本上我正试图从我的iOS应用程序上运行UI自动化,并收到以下错误消息:
2013-02-22 13:12:17.820 ScriptAgent [16626:2e07] + [UIAXElement initialize]:UIAutomation从未收到过kAXAccessibilityLoaded.等了20.02秒.
2013-02-22 13:12:17.826 ScriptAgent [16626:2e07] - [UIAXElement_0xad343c initialize],/ SourceCache/UIAutomation_Sim/UIAutomation-271/Framework/UIAXElement.m第165行,kAXErrorServerNotFound中出现意外错误
2013-02-22 13:12:17.828 ScriptAgent [16626:2e07]由于未捕获的异常'kUIAExeceptionAccessibilityError'而终止应用程序,原因:'UIAXElement_0xad343c初始化中出现意外错误,/ SourceCache/UIAutomation_Sim/UIAutomation-271/Framework/UIAXElement .m第165行,kAXErrorServerNotFound'
第一次抛出调用堆栈:(0x491012 0x1b78e7e 0x490deb 0xa8a55b 0x1b797cf 0x1b80a0d 0x1b77aeb 0x1b77e22 0x1b8a0e1 0xaa2605 0xa847 0x5d8d 0x866d 0x2925)libc ++ abi.dylib:terminate调用抛出异常
2013-02-22 13:12:18.264仪器[16585:2227]自动化仪器在尝试运行脚本时遇到异常.UIAScriptAgentSignaledException
2013-02-22 19:12:18 +0000失败:尝试运行脚本时发生错误.仪器跟踪完成(时间:41.326542s;输出:/Users/newmanp/Work/iOS/CMAiPad/CMA.Mobile/UIScripts/instrumentscli3.trace)
我搜索kAXAccessibilityLoaded或kAXErrorServerNotFound并且根本没有点击.这是我的命令行调用的样子:
instruments -t~/Work/iOS/Platforms/iPhoneOS.platform // Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate/Users/newmanp/Library/Application\Support/iPhone\Simulator/6.0/Applications/B60B9BD7-357D-49AA-9E6F-986929C5D151/CMA.app -e UIASCRIPT ./cmaAutomationTests.js -e UIARESULTSPATH"."
任何关于我可能做错的建议都非常感谢.
我正在为我的桌面应用程序使用 Python 编写自动化脚本。我正在将 TAB 键/任意键发送到我的 Windows 窗体。但我无法在 Python 脚本中找到该 Windows 窗体的句柄。
这是示例代码片段:
__author__ = 'juhis'
import SendKeys
import sys
import os
from Tkinter import *
import ctypes
import win32gui
import pywinauto
pwapp = pywinauto.application.Application()
whandle = pywinauto.findwindows.find_windows(title_re='Form1',class_name='WindowsForms10.Window.8.app.0.2bf8098_r13_ad1')[0]
window1 = pwapp.window_(handle=whandle)
window1.SetFocus()
SendKeys.SendKeys("""{PAUSE 2}""")
SendKeys.SendKeys("""{TAB 2}{PAUSE 2}{ENTER}""")
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题。
-谢谢
我曾经从事 web bowers UI 自动化工作。这些元素通过浏览器本机 API 使用 JavaScript 或 Selenium 驱动程序定位。(无论是应用程序本身(即浏览器)提供自动化能力的方式)。
现在我目前的工作是使用窗口 UI 自动化。所以我还在学习一些概念。
这里用于本地UI元素的API是.NET框架中的AutomationElement,我不知道其他人可以使用什么。
我很好奇的一件事是这是如何工作的。此 API 仅适用于在 CLR 上运行的 .NET 应用程序吗?
如果是,那对我来说更有意义。
否则,我无法理解此 API 如何能够从其他应用程序中定位 UI 元素。
有什么区别
1.ViewInteraction v = onView(allOf(withId(R.id.login_card_view), isDisplayed()))
和
2.v.check(matches(isDisplayed()))
isDisplayed()如果我在 2 中做同样的事情,那么 1有什么用呢?
我试图在 selenium 完成执行我的测试脚本后保持 chrome 浏览器打开。我想重新使用同一个窗口来运行第二个脚本。
python selenium webdriver ui-automation selenium-chromedriver
我正在尝试自动化接入点 Web 配置。在此期间,我会弹出一个窗口(类似于“是”和“否”的叠加层),我想点击它
我试图点击的叠加层的 HTML 代码:
<div id="generic-warning-dialog" class="dialog exclamation text-orphan" style="">
<div class="warning-content dialog-content text-orphan">Security Mode is disabled on one or more of your wireless networks. Your network could be open to unauthorized users. Are you sure you wish to proceed?</div>
<div class="dialog-buttons text-orphan">
<button class="cancel">No</button>
<button class="submit" style="display: block;">Yes</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我试过
browser.find_element_by_class_name("submit").click()
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
引发 exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementClickInterceptedException:消息:元素在点 (788,636.5) 处不可点击,因为另一个元素遮住了它
你能告诉我应该如何进行吗?我正在使用火狐和蟒蛇
我正在尝试写一些东西来检查以下页面上是否存在“关于我们”:https : //www.aggrowth.com/zh-cn/about-us,而我刚刚碰壁。这应该不难,但是我花了太多时间在这上面。
我们正在使用Gherking-testcafe:https ://www.npmjs.com/package/gherkin-testcafe
NPM: 6.9.0
TestCafe: 1.0.1
Gherking-Testcafe: 2.0.0
我尝试过(以下所有内容均经过测试隔离,也就是所有不同的t.expect均由他们自己运行):
const h1AboutUs = await Selector('h1');
await t.expect(h1AboutUs.innerText).eql('About Us');
await t.expect(h1AboutUs.innerText).contains('About Us');
await t.expect(h1AboutUs.value).eql('About Us');
await t.expect(Selector('html').textContent).contains('About Us');
Run Code Online (Sandbox Code Playgroud)
并尝试删除等待:
const h1AboutUs = Selector('h1');
await t.expect(h1AboutUs.innerText).eql('About Us');
await t.expect(h1AboutUs.innerText).contains('About Us');
await t.expect(h1AboutUs.value).eql('About Us');
await t.expect(Selector('html').textContent).contains('About Us');
Run Code Online (Sandbox Code Playgroud)
如果我这样做,它将起作用:
这是我的测试:
When("I see the page load", async t => {
const h1AboutUs = await Selector('h1');
await t.expect(h1AboutUs.visible).eql(true);
await t.hover(h1AboutUs);
await t.expect(h1AboutUs.value).contains('about');
console.log(h1AboutUs.value);
});
Run Code Online (Sandbox Code Playgroud)
我的testCafe赛跑者:
const createTestCafe = require('gherkin-testcafe');
const fs …Run Code Online (Sandbox Code Playgroud) automated-tests web-testing ui-automation e2e-testing testcafe
上下文:我在第 1 页有一个带有 innerText 的元素,在第 2 页有另一个带有 innerText 的元素。我需要比较第 3 页中的这两个值。所以我需要找到一种方法将这些值保存在全局变量中,以便它们可以稍后使用。
我尝试过的事情:
试验 1:不起作用,因为 page1value 范围仅限于 cy.get()
cy.get('#selector').invoke('text').then(text => {
const page1value = text
})
Run Code Online (Sandbox Code Playgroud)
试验 2:每当我尝试在外部打印值时,它都不起作用,它是未定义的或初始化时使用的值。
it('TC Name', () => {
let page1value,
cy.get('#selector').invoke('text').then(text => {
page1value = text
})
cy.log(page1value) //comes as undefined
})
Run Code Online (Sandbox Code Playgroud)
试验 3:使用 .as() 以及它的到来是未定义的。
let page1value;
cy.get('#selector').invoke('text').as('page1value');
cy.log(page1value) //comes as undefined
Run Code Online (Sandbox Code Playgroud)
如果有人能告诉我我哪里做错了,那就太好了。
javascript global-variables ui-automation e2e-testing cypress
ui-automation ×10
e2e-testing ×2
python ×2
selenium ×2
.net ×1
android ×1
c# ×1
cypress ×1
deployment ×1
firefox ×1
hamcrest ×1
ios ×1
javascript ×1
python-2.7 ×1
pywinauto ×1
testcafe ×1
web-testing ×1
webdriver ×1
winapi ×1
windows ×1
winforms ×1