← Back to team overview

sikuli-driver team mailing list archive

[Question #206119]: Problem with Multi-Monitor-Switching (Windows 7)

 

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

Hello everybody!

We are currently setting up a huge collection of test-scripts.
There we have to work some things on Monitor A and some things on Monitor B and then compare the results.

This is our code so far (stripped down just for testing):
--- 
from sikuli import *

# Screen switchting only works once here:
#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__)

def prepareScreenForTesting():
    print("prepareScreenForTesting: START")
    # Reposition the cursor to top and reload the website
    type(Key.HOME) 
    type(Key.F5)
    # Wait for screen reload
    wait(1)
    inside().wait("Fertig.png",FOREVER)
    #inside().wait("Zertid.png",FOREVER)
   
    print("prepareScreenForTesting: DONE")

def Test_Q():
    popup("Run Test Q")

def Test_T():
    popup("Run Test T")

def Compare():
    popup("Starting comparison")

def runModule():
    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__)
    prepareScreenForTesting()
    Test_Q()    

    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__)
    prepareScreenForTesting()
    Test_T()    

    Compare()


runModule()
---

As you can see, runModule should switch the screen, run the Q-Tests and then switch the screen and run the P-Tests.
Unfortunately that doesn't work...
It only works once if we put the code for the screen-switching to the top. Even though we have to quit sikuli and re-open
the test whenever we change the number of the screen.

And as you might already have guessed: We need HELP :-(

Thanks already in advance for your help!

Best regards,

Christian

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