簡體   English   中英

使用sikuli Webdriver測試圖像在地圖中的位置

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM