问题标签 [xcuitest]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ios - 使用 xcui 测试将应用程序保持在后台
完成一项测试后,我试图将我的应用程序保持在后台,然后再次从后台打开应用程序以查看通知屏幕
感谢您的回复
谢谢斯里
swift - 如何识别 XCUITest 在 xcode 中运行时抛出的一些随机寡妇
我们有 UI 自动化代码来测试我们的应用程序。当测试套件随机运行时,钥匙串会抛出一个窗口来输入凭据以访问钥匙串项目。我们不确定何时抛出该窗口。一旦 Keychain 抛出一个窗口来输入我们的测试用例块的凭据。
如何识别随机抛出的窗口或 UI,以输入钥匙串项的凭据。
xcode-ui-testing - 如何让 XCUITest 应用程序(XCUI 测试应用程序,而不是 SUT)访问照片库?
我希望能够让我的 XCUITest 应用程序将图像发布到服务器。我已经使用xcrun simctl addmedia
命令安装了图像,但我不知道如何从 XCUITest 类访问它。
ios - I set up Appium for Real iOS device, Unable to launch WebDriverAgent because xcodebuild failed with code 65
I am trying to run Appium on a real iOS device. I have been able to successfully run it on android, but when I try running for iOS I get the error. Here is my environment:
Appium v1.8.0
iPhone SE 11.2.6
Xcode 9.3.1
I’ve read that error 65
is often caused by using a free account, but I’m using the xcodeSigningId
for our development team.
I would rather the automatic configuration work, but I tried the manual configuration anyway, but I don’t think I did it right. I followed the steps from this site:
https://huddle.eurostarsoftwaretesting.com/how-to-set-up-appium-on-a-mac-fast-java/
This command from this site did not work for me:
This command does not work, neither before nor after I changed the id out for my phone’s uid. I get the error:
option ‘Destination’ requires at least one parameter of the form ‘key=value'
but I’m not sure where this key is supposed to come from or how exactly to format it.
I’ve also tried redownloading various dependencies, making sure I didn’t use sudo. This didn’t help.
I’ve included the full Appium log below:
I've been stuck on this problem for so many days. Any help would be greatly appreciated.
ios - XCUITest 如何与 webview 元素交互
在 XCUITest 中,我正在努力与 webview 元素进行交互。我试图自动化的应用程序主要由本机屏幕组成,它们工作正常,但有些流程在 webviews 中,显然没有像本机元素那样的 AccessibilityID。
这一定是应用程序自动化所需的相当普遍的事件。
我尝试了一个在 web 元素上使用标签的建议,但这也不起作用。
我只是想像用户一样与网络表单进行交互,我可以通过引用 StaticText 在某种程度上使用一些元素,但这是一种不好的方法。
ios - UITest之间的App终止速度慢
我们目前面临的问题是我们的 UITest 需要很长时间。
原因是应用程序从最后一次 UITest 终止需要 20 到 50 秒。使用 90 UITest,我们目前的一轮测试时间为 90 分钟(由于 90 分钟的限制,目前在我们的 CI 上失败了)。
这里是测试步骤的一个小输出。
我们尝试在每个 UITest 结束时终止应用程序,但它只是将“等待”时间移到了 UITest 结束。
我们正在使用Cucumberish从小黄瓜文件中生成测试。但是我们使用 XCUITests 运行测试。
对于可能导致终止需要这么长时间的各种原因,我将不胜感激。
xcode-ui-testing - 元素查询以检索最高数量的元素
我知道有一个 firstMatch 变量可用于获取查询找到的第一个元素。但是,我找不到任何东西来检索找到的第一个或最多的元素。
现在,我一直在使用 allElementsBoundByIndex 来获取整个数组,并且只遍历我需要的数字。
如果没有办法轻松获得顶级元素,我该如何优化呢?
编辑:这是我用来处理它的代码。
ios - UITests 在组中运行时失败,但在独立运行时成功
我目前正在开发一个包含许多异步代码的项目,并且正在为这个项目编写 UITests。在开发过程中,我一个一个地运行它们,但从未在一个组中运行。所以我认为测试成功了。但是当一起测试它们时,它们中的大多数都失败了。我正确实施了设置和拆卸。我研究了这种行为的原因,但我找不到任何好的答案来解决这个问题。这就像等待期望没有正常工作......
这是导致大多数问题的方法。每次我想等待一个元素出现时,我都会调用它。
有没有人有 UITest 异步代码的好方法?
非常感谢您!
更新
这是我收到的错误警告。
大多数时候我只是得到:Asynchronous wait failed: Exceeded timeout of 10 seconds, with unfulfilled expectations: "Expect predicate
exists == 1for object
但该元素在模拟器中是可见和可点击的。另一方面,我得到:caught "NSInternalInconsistencyException", "API violation - creating expectations while already in waiting mode."
...
ios - 使用本机反应的 UI 测试。如何修复时间戳事件匹配错误:找不到匹配元素
我正在尝试将 UI 测试集成到一个相当大的反应原生项目中。但是只要我想记录 ui 测试,我就会收到警告
Timestamped Event Matching Error: Failed to find matching element
这是我要击中的 ui 元素。
我刚刚建立了一个新的 react native 项目,并试图让 ui 测试运行,这很好。所以这让我想到了元素检索被现有代码/构建设置以某种方式阻止的问题。
有什么想法可以禁用或阻止 ui 测试吗?
swift - XCUIElementQuery 返回不包含特定元素的元素
正如标题所示,我需要找到更好的方法来访问不包含特定对象的元素或单元格。
对象总是存在或不存在。同一元素中也没有重复项。
目前,我正在做的是匹配我需要的主要元素,并逐个检查它的子元素,直到我得到我想要的。