← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #173203]: image found, but region location wrong

 

Question #173203 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/173203

    Status: Answered => Open

Beth Griffin is still having a problem:
1. While the BP symbol is in a column, the column itself may be in a
different location based on user/machine settings (like language).  It
isn't always easy to find the correct location with one algorithm.
While it is usually relevant to the source editor, it is not always
visible until AFTER the breakpoint has been hit, and I am using the
existence of the BPArrow symbol to tell me the breakpoint is hit.

On that note:

2. The following code example show the really strange behavior:

def SobelFilterTest (unittest.TestCase):

    def setUp(self):
        ...
        self.BPRegion = None
        ...

    def BPArrowAppearHandler(self, event):
        self.BPRegion = event.region
        # or self.BPRegion = getLastMatch()
        event.region.stopObserver

    def test_SobelFilter(self)
        # open a solution in MS VS
        ...
        nArrow = Pattern("BPArrow.png")
        onAppear(nArrow, self.BPArrowAppearHandler)
        observe(300)
        self.BPRegion.highlight()
        wait(30)
        self.BPRegion.highlight()


I run the script using 

mySobelFilterTest = unittest.TestLoader().loadTestsFromTestCase(SobelFilterTest)
unittest.TextTestRunner(verbosity=2).run(mySobelFilterTest)

If BPRegion = event.region: region = point, highlight shows nothing
If BPRegion = getLastMatch(): region = rectangle (larger than image), and highlight appears in the wrong location

I tried doing

myVSRegion = App.focusedWindow()
# to really narrow down:
#  mySolExpRegion = myVSRegion.find("SolExpTitleBar.png").below()
#  Start debugging (solution explorer can move from left side to right side or vice versa
#  At break, which I am waiting for by waiting for the BPArrow.png, so already there is a catch 22
myVSRegion.onAppear("BPArrow.png", BPArrowAppearHandler)

I get an error trying to assign the 2nd argument of onAppear.

So, using a smaller region seems broken, using the full screen is broken
too.

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