Running calculator

Asked by Soni

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:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
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

Revision history for this message
Soni (soni12) 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.

Revision history for this message
Soni (soni12) 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.

Revision history for this message
RaiMan (raimund-hocke) said :
#4

use the SikuliX IDE in parallel to capture the images.

Revision history for this message
Soni (soni12) 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.
>

Revision history for this message
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.

Revision history for this message
Soni (soni12) 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.
>

Revision history for this message
Soni (soni12) 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.
>

Revision history for this message
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.

Revision history for this message
Soni (soni12) 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.
>

Revision history for this message
Soni (soni12) 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.
>>
>
>

Revision history for this message
RaiMan (raimund-hocke) said :
#12
Revision history for this message
Soni (soni12) said :
#13

Hi,

How to handle pop up screens when testing another an application?

I want to click on button inside the pop up window and continue with the
screen.

Thanks for help.

On Fri, May 4, 2018 at 6:43 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:
> http://sikulix.com
>
> --
> 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=11
>
> 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.
>

Revision history for this message
RaiMan (raimund-hocke) said :
#14

If you are talking about asynchronous events happening while your workflow is running, then you have the observe feature, that allows to watch for events on the screen in parallel.
http://sikulix-2014.readthedocs.io/en/latest/region.html#observing-visual-events-in-a-region

Can you help with this problem?

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

To post a message you must log in.