2016-01-20 61 views
2

我一直在尋找解決方案的網絡,但我沒有找到這個具體問題。我需要Sikuli同時定位在屏幕上兩個圖像,雖然這並沒有發生,執行操作:Sikuli檢查屏幕上出現兩個不同的圖像

while not (exists (refSet.getImage("image1")) & exists(refSet.getImage("image2"))): 
     click(Pattern(refSet.getImage("image3"))) 

while not exists ((refSet.getImage("image1")) & (refSet.getImage("image2"))): 
     click(Pattern(refSet.getImage("image3"))) 

我得到一個錯誤:

類型錯誤:不支持的操作數類型(s)&:'org.sikuli.script.Match'和'NoneType'

Anybody知道如何解決這個問題?謝謝您的幫助。

回答

0

如果有人需要它,我解決了它創建我自己的功能,但更好的想法感激!

def findTwoImages(self, image1, image2): 
    bBoth = False 
    imageCount = 0 
    if exists(refSet.getImage(image1)): 
     imageCount += 1 
    if exists(refSet.getImage(image2)): 
     imageCount += 1 
    if (imageCount == 2): 
     bBoth = True 
    return bBoth 
相關問題