使用 Appium iOS 自动化的操作链时出现"Method has not yet been implemented"错误



我目前为我的 Web 应用程序提供了用于 Web 浏览器自动化的脚本,我正在尝试实现这些用于移动自动化的脚本。一切似乎都有效,但我的代码将在我实现"行动链"的地方退出,并收到"方法尚未实现"的错误。行动链与 Appium 不兼容吗?

另外,我尝试使用触摸操作代替操作链,但它给了我错误,例如

AttributeError: ‘int’ object has no attribute ‘id’
‘Str’ object has no attribute ‘id’

我在某处看到TouchAction只能在本机环境中工作。我正在尝试在iPad上测试我的网络应用程序,那么TouchAction不支持Web上下文吗?

据我所知,TouchAction只模拟对屏幕的"物理"触摸或手势,它与后端发生的事情无关。 对于 行动链 ,我相信您需要进行一些调整才能使其在移动设备上运行:

'driver.execute_cdp_cmd('Emulation.setDeviceMetricsOverride', {height:y, width:x}) # height and width of screen
driver.execute_cdp_cmd('Page.setDeviceMetricsOverride', emulation)
config, enabled = 'mobile', True
browser.execute_cdp_cmd('Emulation.setEmitTouchEventsForMouse', {'enabled': enabled, 'configuration': config})
maxpoints = 3
driver.execute_cdp_cmd('Emulation.setTouchEmulationEnabled', {'enabled': enabled, 'maxTouchPoints': maxpoints})'

也许这些会起作用!

相关内容

最新更新