← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #668106]: Running calculator

 

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

    Status: Answered => Open

Poornima Tunga is still having a problem:
Hi Raiman,

While running calculator example the function used to get the result panel
data:
public String getResults() throws FindFailed, UnsupportedFlavorException,
IOException, InterruptedException {
Thread.sleep(100);
screen.click("\\img\\ResultPanel.PNG");
screen.type("c", Key.CTRL);

Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable contents = clipboard.getContents(DataFlavor.stringFlavor);
String results = (String) contents.getTransferData(DataFlavor.stringFlavor);

System.out.println("results >> " + results);
return results;
}

I am geting error here,
where ever my cursor is placed before running the test i am getting that
string as part of results panel?
and my calculator is:


For this how to get the result panel image?

Thanks

On Mon, Apr 23, 2018 at 7:23 PM, RaiMan <
question668106@xxxxxxxxxxxxxxxxxxxxx> wrote:

> Your question #668106 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/668106
>
>     Status: Open => Answered
>
> RaiMan proposed the following answer:
> If we are talking about Java programming, then this is simply Java: put
> jar to classpath and run the main function.
>
> If we are talking about scripting in the IDE, then you have the same
> situation, since we are in a Java environment.
>
> In any case you can always delegate a "java -jar whatever.jar" to a
> subprocess.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/sikuli/+question/668106/+confirm?answer_id=5
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/sikuli/+question/668106
>
> You received this question notification because you asked the question.
>

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