← Back to team overview

sikuli-driver team mailing list archive

[Question #206315]: Problem with Multi-Monitor-Switching (Part 2)

 

New question #206315 on Sikuli:
https://answers.launchpad.net/sikuli/+question/206315

Hi,

a colleague of mine posted a problem with multi-monitor-switching before, using a global screen variable solved the basic problem of switching between monitors.

Now I am trying to extract text from a region with the following code, while trying to do this the switching to the second monitor does not work any more. 
The problem seems to be the above(20) command, all the steps before work and also allow for monitor switching.

---
from sikuli import *

def Test_Q():
    click("searchButton.png")
    wait("imageBelowResultNumber.png",FOREVER)
    exportLabel = find("imageBelowResultNumber.png")
    resultLabel = exportLabel.above(20)
    resultLabel.highlight(2)
    numResultsQ = resultLabel.text()
 
def Test_T():
    click("searchButton.png")
    wait("imageBelowResultNumber.png",FOREVER)
    exportLabel = find("imageBelowResultNumber.png")
    resultLabel = exportLabel.above(20)
    resultLabel.highlight(2)
    numResultsT = resultLabel.text()

def runModule():
    global SCREEN 
    Settings.myScreen = 0 # 0 = left display (Notebook), 1 = middle display, 2 = right display
    SCREEN = Screen(Settings.myScreen)
    dict = globals()
    dict['SCREEN'] = SCREEN
    dict['SCREEN']._exposeAllMethods(__name__)
    Test_Q()    

    Settings.myScreen = 1 # 0 = left display (Notebook), 1 = middle display, 2 = right display
    SCREEN = Screen(Settings.myScreen)
    dict = globals()
    dict['SCREEN'] = SCREEN
    dict['SCREEN']._exposeAllMethods(__name__)
    Test_T()

runModule()
---

Any ideas why this happens?

Best regards,
Matthias


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.