[英]Test the position of the image in map using sikuli webdriver
我不确定sikuli webdriver是否有可能。 我已经在互联网上进行搜索,但找不到有关此事的任何文章。 我要做的是获取地图中给定图像的纬度和经度以进行测试。 sikuli Web驱动程序可能与这有关吗? 如果没有,是否有其他解决方案来测试地图? 任何提示或链接的教程,将不胜感激。
我想您可能正在寻找这样的东西:在sikuli doc中,您可以找到有关如何获取位置的一些信息: Location上的doc.sikuli
示例代码:(使用Python的Sikuli)
class Cords():
def __init__(self):
# Find the image
imageLoc = find("image1.png")
# Get the X, Y position
x = imageLoc.getX() # For example: x = 499
y = imageLoc.getY() # For example: y = 811
# Print the positions
print(x, y)
# Look if the image is on this given position.
if (imageLoc.getX() == 499) and (imageLoc.getY() == 811):
print('Correct')
else:
print('Incorrect')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.