popups on wrong screen

Asked by muni on 2020-03-13

I have a issue with popups show in a different screen rather than defined.
I have two screen 1 and 2
popups always popup in the screen 2 or vice versa. could you please assist me if iam missing anything in specific here??

import shutil
import os
import subprocess
scr1=Screen(0)
scr1.find("1582743393321-3.png")
itracapp = App(r'C:\Program Files (x86)\Deutsche Bank\Autobahn Toolbar (UAT)\AutobahnBootstrapper.exe')
#subprocess.call(r'C:\Program Files (x86)\Deutsche Bank\Autobahn Toolbar (UAT)\AutobahnBootstrapper.exe')
itracapp.open()
itracapp.focus()
searchbar = exists("1583244105302-2.png")
if exists("1583244105302-2.png"):
    click("1583244159790-2.png")
    type('itrac dashboard'+ Key.ENTER)
else:

    wait("toolbar3-2.png",60)
    wait(2)
    appicon=findAll(Pattern("1582824632346-3.png").similar(0.82))

    click(Pattern("1582730255577-3.png").targetOffset(-1,-5))
    wait(2)

    wait(Pattern("1582730978402-3.png").similar(0.86),10)

#def startitrac():
    searchbar = find(Pattern("1582730978402-3.png").similar(0.85))

    click(Pattern("1582730978402-3.png").similar(0.85).targetOffset(-94,1))
    type('itrac dashboard'+ Key.ENTER)
    #wait(13)
where = Region(0,0,546,303)
launcherissue = exists(Pattern("1582814114669-3.png").similar(0.81),15)
#itracapp.focus(iTrac Dashboard,[1])
while exists(Pattern("1582814114669-3.png").similar(0.81)):
    #itracapp.focus(iTrac Dashboard,[1])
    wait(2)
    #
    where = Region(525,488,733,241)
    result = Do.popError("", "Unable to Launch the dashboard-retsrate is required", "", False, 3)
    click("1582821885318-3.png")
    wait(2)

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
muni
Solved:
2020-03-16
Last query:
2020-03-16
Last reply:
2020-03-16
RaiMan (raimund-hocke) said : #1

made some quick tests with a 2 monitor setup in Windows 10:

if nothing else is said, the the Do.pop... features are always shown on the primary monitor (Python: SCREEN or Screen(0)), which has the point (0, 0) in the global coordinate system.

BTW:
result = Do.popError("", "Unable to Launch the dashboard-retsrate is required", "", False, 3)

should be

result = Do.popError("Unable to Launch the dashboard\nretsrate is required", 3)

the first string is the message shown in the box, the second parameter is the title of the box.

if you want to have a Do.pop... on a specific of your screens:

result = Do.popError("", "Unable to Launch the dashboard-retsrate is required", "", False, 3, Screen(1))

which would display the popup on the first not-primary monitor.

muni (rajeshmuni) said : #2

Hi Raiman,
Thank you very much,it worked.
however i want the pop ups to auto closed,hence i used this result = Do.popError("", "Unable to Launch the dashboard-retsrate is required", "", False, 3)

when i used your suggested statement result = Do.popError("Unable to Launch the dashboard\nretsrate is required", 3) it is not getting auto closed.

RaiMan (raimund-hocke) said : #3

result = Do.popError("Unable to Launch the dashboard\nretsrate is required", 3)

works for me as it should: closes after 3 seconds (using 2.0.4)

muni (rajeshmuni) said : #4

is that might be a reason because iam using 2.0.2 ??

RaiMan (raimund-hocke) said : #5

probably yes, because the short parameterlists for pop... where fixed with 2.0.3

muni (rajeshmuni) said : #6

ok thank you RaiMan i will try upgrading.