Running calculator

Asked by Poornima Tunga on 2018-04-19

I am running one of the sikuli calculator GUI testing code in java eclipse
Getting an error:
Exception in thread "main" FindFailed: /img/C.PNG: (58x23) in S(0)[0,0 1920x1080] E:Y, T:3.0
can you please help
Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-05-04
Last reply:
2018-05-04
RaiMan (raimund-hocke) said : #1

What version of SikuliX?

normal Eclipse project or Maven project?

Did you tell SikuliX where the images are?
http://sikulix-2014.readthedocs.io/en/latest/scripting.html#image-search-path-where-sikulix-looks-for-image-files

Poornima Tunga (poornima12) said : #2

HiThanks for the reply.Actually the calculator i have is different from the one in the images.can i know how to take images of each numbers
ThanksPoornima

Sent from my Samsung Galaxy smartphone.
-------- Original message --------From: RaiMan <email address hidden> Date: 20/04/18 19:17 (GMT+12:00) To: <email address hidden> Subject: Re: [Question #668106]: Running calculator
Your question #668106 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/668106

    Status: Open => Needs information

RaiMan requested more information:
What version of SikuliX?

normal Eclipse project or Maven project?

Did you tell SikuliX where the images are?
http://sikulix-2014.readthedocs.io/en/latest/scripting.html#image-search-path-where-sikulix-looks-for-image-files

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/sikuli/+question/668106

You received this question notification because you asked the question.

Poornima Tunga (poornima12) said : #3

Hi Raiman,I am using Eclipse projectSikuli is the latest version.
ThanksPoornima

Sent from my Samsung Galaxy smartphone.
-------- Original message --------From: RaiMan <email address hidden> Date: 20/04/18 19:17 (GMT+12:00) To: <email address hidden> Subject: Re: [Question #668106]: Running calculator
Your question #668106 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/668106

    Status: Open => Needs information

RaiMan requested more information:
What version of SikuliX?

normal Eclipse project or Maven project?

Did you tell SikuliX where the images are?
http://sikulix-2014.readthedocs.io/en/latest/scripting.html#image-search-path-where-sikulix-looks-for-image-files

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/sikuli/+question/668106

You received this question notification because you asked the question.

RaiMan (raimund-hocke) said : #4

use the SikuliX IDE in parallel to capture the images.

Poornima Tunga (poornima12) said : #5

Hi Raiman,

Can i run any application from this sikuli tool like any .jar executables?

Thanks

On Sat, Apr 21, 2018 at 12:16 AM, RaiMan <
<email address hidden>> wrote:

> Your question #668106 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/668106
>
> Status: Open => Answered
>
> RaiMan proposed the following answer:
> use the SikuliX IDE in parallel to capture the images.
>
> --
> 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=3
>
> 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.
>

RaiMan (raimund-hocke) said : #6

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.

Poornima Tunga (poornima12) said : #7

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 <
<email address hidden>> 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.
>

Poornima Tunga (poornima12) said : #8

Hi Raiman,

I am trying to do enter data on text box using
Keyboard keyboard = new DesktopKeyboard();

Trying to import his class from sikuli API, but could not get it going.

 sikulixapi.jar
<https://drive.google.com/file/d/1bJzetgbDL2keaiV_EuCe2RZTXsEC-597/view?usp=drive_web>

Attached my jar.

Any help would be appreciated.

Thanks

On Fri, Apr 27, 2018 at 2:43 PM, Poornima Tunga <
<email address hidden>> wrote:

> Your question #668106 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/668106
>
> Status: Answered => Open
>
> You are 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 <
> <email address hidden>> 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 you asked the question.
>

RaiMan (raimund-hocke) said : #9

Keyboard keyboard = new DesktopKeyboard();

is not valid API for sikulixapi.jar.

You are not using one of the SikuliX packages.

Poornima Tunga (poornima12) said : #10

Is there any function that selects item from dropdown list in Sikuli?
If so can you provide me with the sample code

Thanks
Poornima

On Wed, May 2, 2018 at 6:58 PM, RaiMan <<email address hidden>
> wrote:

> Your question #668106 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/668106
>
> Status: Open => Answered
>
> RaiMan proposed the following answer:
> Keyboard keyboard = new DesktopKeyboard();
>
> is not valid API for sikulixapi.jar.
>
> You are not using one of the SikuliX packages.
>
> --
> 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=8
>
> 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.
>

Poornima Tunga (poornima12) said : #11

Where can i get the sikulix pacakges?

On Thu, May 3, 2018 at 5:37 PM, Poornima Tunga <email address hidden>
wrote:

> Is there any function that selects item from dropdown list in Sikuli?
> If so can you provide me with the sample code
>
>
> Thanks
> Poornima
>
> On Wed, May 2, 2018 at 6:58 PM, RaiMan <question668106@answers.
> launchpad.net> wrote:
>
>> Your question #668106 on Sikuli changed:
>> https://answers.launchpad.net/sikuli/+question/668106
>>
>> Status: Open => Answered
>>
>> RaiMan proposed the following answer:
>> Keyboard keyboard = new DesktopKeyboard();
>>
>> is not valid API for sikulixapi.jar.
>>
>> You are not using one of the SikuliX packages.
>>
>> --
>> 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/+confi
>> rm?answer_id=8
>>
>> 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.
>>
>
>

Can you help with this problem?

Provide an answer of your own, or ask Poornima Tunga for more information if necessary.

To post a message you must log in.