如何使用UIDocumentBrowserViewController

时间:2019-02-16 04:55:34

标签: ios uitest

我用UIDocumentBrowserViewController编写了一个应用程序。 当我选择一个文档时,从应用程序启动记录UI测试时出现错误

时间戳事件匹配错误:找不到匹配的元素

相反,使用以下命令启动和记录视图层次结构

printd(XCUIApplication().debugDescription)

我得到以下结果:

Attributes: Application, pid: 1564, label: 'TestApp'
Element subtree:
→Application, 0x2808e4000, pid: 1564, label: 'TestApp'
    Window (Main), 0x2808e40d0, {{0.0, 0.0}, {320.0, 568.0}}
      Other, 0x2808e41a0, {{0.0, 0.0}, {320.0, 568.0}}
    Window, 0x2808e4270, {{0.0, 0.0}, {320.0, 568.0}}
      Other, 0x2808e00d0, {{0.0, 0.0}, {320.0, 568.0}}
        Other, 0x2808e01a0, {{0.0, 0.0}, {320.0, 568.0}}
          Other, 0x2808e0270, {{0.0, 0.0}, {320.0, 568.0}}
    Window, 0x2808e0340, {{0.0, 0.0}, {320.0, 568.0}}
      StatusBar, 0x2808e0410, {{0.0, 0.0}, {320.0, 20.0}}
        Other, 0x2808e04e0, {{0.0, 0.0}, {320.0, 20.0}}
        Other, 0x2808e05b0, {{0.0, 0.0}, {320.0, 20.0}}
          Other, 0x2808e0680, {{6.0, 0.0}, {17.0, 20.0}}, label: '3 of 4 bars, signal strength'
          Other, 0x2808e0750, {{26.0, 0.0}, {65.0, 20.0}}, label: ‚xxx network'
          Other, 0x2808e0820, {{96.0, 0.0}, {15.0, 20.0}}, label: '3 of 3 Wi-Fi bars', value: SSID
          Other, 0x2808e08f0, {{146.0, 0.0}, {33.0, 20.0}}, label: '17:59'
          Other, 0x2808e09c0, {{280.0, 0.0}, {35.0, 20.0}}, label: '98 % battery power, Charging'
    Window, 0x2808e4340, {{0.0, 0.0}, {320.0, 568.0}}
      Other, 0x2808e4410, {{0.0, 0.0}, {320.0, 568.0}}
      Other, 0x2808e44e0, {{0.0, 0.0}, {0.0, 0.0}}
    Window, 0x2808e45b0, {{-0.0, -0.0}, {320.0, 568.0}}
      Other, 0x2808e4680, {{-0.0, -0.0}, {320.0, 568.0}}
        Other, 0x2808e4750, {{0.0, 0.0}, {320.0, 568.0}}
          Other, 0x2808e4820, {{-0.0, -0.0}, {320.0, 568.0}}
Path to element:
→Application, pid: 1564, label: 'TestApp'
Query chain:
→Find: Target Application ‚xxx.TestApp'
  Output: {
    Application, pid: 1564, label: 'TestApp'
  }

看不见文档(此运行期间为3)。所以我无法访问它们。

是否有必要进行配置以将它们包括在视图层次结构中(带有标签?)

XCode 10.1在iPhone和iPad(均为无模拟器)iOS 12.1.4上进行了测试

0 个答案:

没有答案