region below and above keyword

Asked by Maniraj on 2017-11-30

Hi,

I am trying to Set a region , see below code i set region but it is not working, below(100) there will be no "Noteicon" but it is clicking how we can handle this.

IMP: It is taking Screenshot correctly in the specified region - Below(100).

Request you to explain in details help me out to fix this issue.

                 Screen screen = new Screen();
                Region r = new Region(screen);
  r.find(VisText).below(100).saveScreenCapture("/Users/ar/Desktop/","G");
  r.find(VisText).below(100).click(Noteicon);

Question information

Language:
English Edit question
Status:
Expired
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2017-12-01
Last reply:
2017-12-16
RaiMan (raimund-hocke) said : #1

using the latest SikuliX version? 1.1.1 or 1.1.2 nightly

Maniraj (aathimaniraj) said : #2

yes using 1.1.1 version

RaiMan (raimund-hocke) said : #3

suggestion for the above:

Screen screen = new Screen();
Region reg = r.find(VisText).below(100); // comment 1
reg.highlight(2); // comment 2
reg.click(Noteicon); // comment 3

-- comment 1:
store the evaluated Region for later use to avoid a new search

-- comment 2:
gives you direct visible feedback of the evaluated region

-- comment 3:
should stop with a FindFailed exception, if Noteicon (supposing it is a String containing an image filename) is not visible in the Region reg

Maniraj (aathimaniraj) said : #4

Hi Having doubt,

                 Region reg = screen.find(Aimage1).above(50); // comment 1
  reg.saveScreenCapture("/Users/855/Desktop/","Q"); // comment 2
  reg.highlight(2); // comment 3
  reg.click(Noteicon); // comment 4

-- comment 4:
It is not Finding Noteicon but Screenshot is taking correctly and in That noteicon is visible too but it is not clicking

Kindly help me out to fix

RaiMan (raimund-hocke) said : #5

Sure that the image Noteicon completely lies inside the Region reg (only 50 pixels in height)?

Launchpad Janitor (janitor) said : #6

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.