我正在使用 VS CODE 来开发一个带有 Robot Framework 和 Sikuli 的机器人。当我运行脚本时出现错误
"could not find P(sage.png)"
发生这种情况是因为当前屏幕是 VS CODE 的屏幕,而不是“sage.png”所在的桌面。
我可以在脚本中使用什么来首先关注桌面屏幕?
最佳答案
我刚刚查看了sikuli的文档。 您可以使用以下方法,他们已经专门讨论了您的问题。
classmethod focusedWindow()
On Windows, this method always returns a region. When there is no window opened on the desktop, the region may refer to a special window such as the task bar or an icon in the system tray.
# highlight the currently fontmost window for 2 seconds
App.focusedWindow().highlight(2)
# save the windows region before
firstWindow = App.focusedWindow()
firstWindow.highlight(2)
关于robotframework - 如何让sikuli专注于桌面屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59218851/