Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Sahi and phantomJs

noizernoizer Members
edited May 2014 in Sahi - Open Source
Hi,
I've installed Sahi under ubuntu 13.10 x64 and it works pretty well. I want to try a load test on a local site so I've installed (from repository) phantomJs. I've followed this: http://sahi.co.in/w/sahi-headless-execution-with-phantomjs
I've created in ~/sahi/extlib/ a file called sahi.js and in browser-type I've putted:
                <browserType>
		<name>phantomjs</name>
		<displayName>PhantomJS</displayName>
		<icon>safari.png</icon>
		<path>/usr/bin/phantomjs</path>
		<options>--proxy=localhost:9999 $userDir/sahi/extlib/sahi.js</options>
		<processName>phantomjs</processName>
		<capacity>5</capacity>
                </browserType>
In sahi.js i've putted:
if (phantom.args.length === 0) {
    console.log('Usage: sahi.js <Sahi Playback Start URL>');
    phantom.exit();
} else {
    var address = phantom.args[0];
    console.log('Loading ' + address);
    var page = new WebPage();
    page.open(address, function(status) {
        if (status === 'success') {
            var title = page.evaluate(function() {
                return document.title;
            });
            console.log('Page title is ' + title);
        } else {
            console.log('FAIL to load the address');
        }
    });
}

when I try to run
sh testrunner.sh ../scripts/myScript.sah http://127.0.0.1/myHost phantomjs
no phantomJs instance is launched. On sahi proxy I can see myScript is running but no browser instace (and no logs written).
Someone can explain me why?

Answers

Sign In or Register to comment.