2

My Sahi execution never ends. It's like there's some kind of deadlock internally.

I have developed a simple example that reproduces the problem. It creates and starts the Sahi proxy, then instantiates a browser and navigates to a web page, then it closes the browser and stops the proxy:

package com.testing;

import net.sf.sahi.Proxy;
import net.sf.sahi.client.Browser;
import net.sf.sahi.config.Configuration;

import static net.sf.sahi.util.Utils.sleep;

public class SahiTest {

    public static void main(String[] args) {
        new SahiTest().test();
    }

    private void test() {

        Configuration.init("/sahi_install_dir", "/sahi_install_dir/userdata");

        Proxy proxy = new Proxy(9999);
        proxy.start(true);

        while (!proxy.isRunning()) {
            sleep(100);
        }

        Browser browser = new Browser("chrome");
        browser.open();

        browser.navigateTo("http://www.kilobolt.com/game-development-tutorial.html");

        browser.close();
        proxy.stop();
    }
}

It all works well but after the last line (stopping the proxy) execution never ends.

I've tried with Chrome and Firefox with same results.

If I get rid of the Browser instantiation (thus only creating and stopping the proxy), the program ends well.

Can anybody help with this please?.

Ricardo
  • 41
  • 6
  • 1
    So it's the browser.close() that never finishes? Could you use a Debugger or check your processes to make sure it's the Browser instances fault. – globalworming Apr 07 '16 at 07:20

0 Answers0