← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #160030]: [HowTo] sort matches returned from findAll()/Finder.find()

 

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

hanumantha Katreddy posted a new comment:
 Hi Raimain,I am new to SikuliX with Java. Can you provide me the java code that you shared with Saorabh Singh, in the same thread?
Sikulix Version : <dependency>      <groupId>com.sikulix</groupId>      <artifactId>sikulixapi</artifactId>      <version>1.1.0</version> </dependency>Thanks,Hanu
    On Saturday, 8 December, 2018, 6:44:38 AM IST, hanumantha Katreddy <question160030@xxxxxxxxxxxxxxxxxxxxx> wrote:  
 
 Question #160030 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/160030

hanumantha Katreddy posted a new comment:
hi Raiman,
I am using SikuliX for past 3 months in Java. I come across a similar problem. My application has a screen, where text fields of similar shape and size are spread in tabular format. i want to input text in to a particular text field based on its sort order either row wise or column wise. Can you explain how to handle in java?
Below is my code...


    public void setText(String elementpath,int clickonnthfind) throws Exception, FindFailed, InterruptedException {
        Region reg = getRegion(rootpath+"Common//TableScreen");
        Pattern pat = new Pattern(elementpath); //text field image pattern
        Iterator <Match> it = reg.findAll(pat); //findAll(textfields));
        
        int nth=1;                
        while(it.hasNext()){
            it.next().click();
            it.next().type(String.valueOf(nth)); //this is randomly picking up text fields and setting text 
            System.out.println("clicked at"+nth);
            Thread.sleep(3000);
            nth++;
            /*if(nth==clickonnthfind){
                it.next().click();
                System.out.println("clicked at"+nth);
                Thread.sleep(3000); 
            }*/    
        }
    }

-- 
You received this question notification because you are subscribed to
the question.

You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.