← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #239377]: Open browser and navigate to particular URL using Java Sikuli api

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
This is principally ok.

What is here?
at com.sikuli.test.SikuliTest.sampleTest(SikuliTest.java:20)

if it is the  app.focus();
then the app.open(); should have worked at least without producing a crash.

So if Firefox is started, then you might try to put a wait(2) after the
open() (wait until GUI is ready)

Internally this is used with open:
      String cmd[] = {"sh", "-c", "(" + appName + ") &\necho -n $!"};
      Process p = Runtime.getRuntime().exec(cmd);

and to find an app's window, the base is:
      String cmd[] = {"wmctrl", "-lpGx"};
      Process p = Runtime.getRuntime().exec(cmd);

The multiline output is scanned for the pid of the running app.
This in your case returns an empty string array (the fact that this is not checked is a bug), which seems to be caused by a not available wmctrl (which again is a bug, since this should be checked before trying to use it), or a wmctrl, that is not working as expected.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.