← Back to team overview

sikuli-driver team mailing list archive

[Bug 1007298] Re: Sikuli returned App.focus failed when integrate into hudson

 

--- supposing that you are using the latest build of Sikuli X-1.0rc3
(r930/931)

--- switchApp() on Windows
1. using a path string usually opens a new instance of the app (if found by the path)
2. using some text (like "google chrome") tries to find an open window, whose title contains the given text and bring it to front (this only might open an app instance, if the given text allows to find the app on the system path with one of the executable suffixes (e.g. switchApp("notepad") opens a new notepad window))

In the combination with Selenium, you should use Selenium to
activate/control the browser and use switchApp() only in cases, where
Selenium does not bring the respective browser window to front. And then
you have to use some distinct text from the respective window title.

So I guess in the second case with path to chrome.exe, a new
instance/window of chrome is opened, which is not the one used by
Selenium (which I guess shows the image you are waiting for, but is
hidden now)

BTW: screen.wait("image.png", 1000) 
will wait 1000 seconds and as far as I know, in Java this has to be a float value.


** Changed in: sikuli
       Status: New => Opinion

** Summary changed:

- Sikuli returned App.focus failed when integrate into hudson
+ Java: Hudson: App.focus fails on remote system

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1007298

Title:
  Java: Hudson: App.focus fails on remote system

Status in Sikuli:
  Opinion

Bug description:
  I need to execute selenium & sikuli (java)test case in remote machine,
  so I create an hudson job and configured a slave node for it. But
  SIKULI  returned App.focus failed when I run it slave node. While it
  works fine if I let hudson execute the test case in local machine.
  Confused about it , does someone have any idea about it?

  // test case example:
  public void setUp(String url) throws Exception {
  		selenium = new DefaultSelenium("localhost", 4444, "*googlechrome", url);
  		selenium.start("captureNetworkTraffic=true");
  		selenium.setSpeed("3000");
  		selenium.windowMaximize();
  		screen = new Screen();
  		sikuliScript = new SikuliScript();
  		sikuliScript.switchApp("google chrome");

                  selenium.open("http://www.google.com";);

                  screen.wait("c:\temp\test.png", 1000);

  }

  
  it returns following error logs in hudson.
     [testng] [info] Windows utilities loaded.
     [testng] [log] App.focusgoogle chrome(0) #0
     [testng] [error] App.focus failed: google chrome not found
     [testng] ===============================================
     [testng] Suite
     [testng] Total tests run: 1, Failures: 1, Skips: 0
     [testng] ===============================================
     [testng] 
     [testng] The tests failed.

  
  if I changed the sikuliScript.switchApp("google chrome") to sikuliScript.switchApp("C:\\Documents and Settings\\XPMUser\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe")

  it will return following logs:
  [testng] [info] Windows utilities loaded.
  [testng] [log] App.focus C:\Documents and Settings\XPMUser\Local Settings\Application Data\Google\Chrome\Application\chrome.exe(0) #0
  [testng] ===============================================
  [testng] Suite
  [testng] Total tests run: 1, Failures: 1, Skips: 0
  [testng] ===============================================
  [testng] 
  [testng] The tests failed.

  no [error] message returned, but the build still failed soon.

  It seems screen.wait("c:\temp\test.png", 1000); is failed when execute
  in slave node, don't know why. Can someone help me?

  Thanks in advance,
  xlzdew

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1007298/+subscriptions


References