我已经开始使用 Squish 来自动化使用 Python 的 Windows 应用程序。一些脚本只与 waitForObject
一起工作,还有一些脚本与 waitForObjectItem
一起工作。什么时候应该使用 waitForObject
什么时候应该使用 waitForObjectItem
?
最佳答案
我经常访问这个:http://doc.froglogic.com/squish/latest/
这真的很有帮助,尤其是当我忘记了什么的时候。这只是有帮助。
在这里,只需从上面的站点复制/粘贴:
waitForObject(objectOrName): Waits until the objectOrName object is accessible (i.e., it exists and is visible and enabled). It returns a reference to the object if successful or raises a (catchable) LookupError exception on failure
waitForObjectItem(objectOrName, itemIdentifier): Waits until the objectOrName object is accessible (i.e., it exists and is visible and enabled), and contains an item that is identified by the itemIdentifier and that is itself accessible. This function is typically used to access items inside containers such as lists, tables, and trees.
现在,换句话说,我明白了
waitForObject:它只是在等待一个现在存在并且可见的对象,这意味着如果你有一个 window1,在 window2 之上,最后一个,window2 因为 window1 而不可见,你不会使用这个功能;
和
waitForObjectItem:考虑到第一个功能,对象存在并且可见且启用,并且此Item 可以是表格的单元格;或树上的 child 等。
关于python - Squish、Python、Windows 应用程序自动化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36440649/