FAQ Database Discussion Community

How do I use the latest Webkit version for Capybara specs using PhantomJS?

A fellow developer told me that PhantomJS uses an old version of Webkit, and that this prevents him from always trusting the results he gets from running Capybara specs using PhantomJS. To my knowledge, PhantomJS is the best headless browser available for running Capybara specs. The only alternatives I've found...

Having trouble getting page.injectJs() to work in PhantomJS

I have the following in my code: phantom.createPage(function(page){ page.onCallback = function(data) { console.log("ph callback: ", data); }; page.open(req.query.testUrl, function(status){ if(status !== 'success'){ page.close(); res.status(500) .send('Page "' + testUrl + '" could not be loaded.') .end(); return; } var result = page.injectJs('lib/my-test-script.js'); console.log('injectJS: ', result); page.evaluate(function(){ window.callPhantom(window.mocha.constructor.name); }, function(){ console.log('finished'); page.close();...

Headless Browserify JavaScript Testing with Phantom.js

I'm trying to find a way to execute the following steps. Write Node.js code for the browser Compile the code with browserify Test the browser code in the terminal I would love to get the console.logs that the browser receives, but within the terminal. This would not only save me...

Selenium Web Driver: findElement(By.name … and headless browser

I'm trying to follow the Selenium Webdrive Tutorial http://www.toolsqa.com/selenium-webdriver/headless-browser-testing-selenium-webdriver/ There is a simple test, here you are the steps: Open webpage http://google.com Get the title of the page. Search for ‘Selenium’ Check the title of the page again. Starting from the class code sample, here you are my code package...

HtmlUnit not creating HtmlPage object

I'm very new to HtmlUnit and I'm trying to scrape a website that uses Javascript to edit the code. I heard HtmlUnit was the best way to go as it returns the final code using a headless browser. However as you will see I cannot even get past creating a...

Running Karma and Protractor tests with or without a headless browser

I am confused about running Karma and Protractor on a TeamCity CI server. Should I run these tests with a headless browser or not and how can I do that?

Awesomium.Net wrapper class for multi-threaded access only works once

to test this class please install Awesomium.Net sdk from here and add a reference to Awesomium.Core.dll to the visual studio project. the problem i'm having with this class is, it only works with the first ever instance. subsequent instances do not result in the appropriate events being fired on the...

Opening pages asynchronously in headless browser (PhantomJS)

I am using PhantomJS via Python through Selenium+Ghostdriver. I am looking to load several pages simultaneously and to do so, I am looking for an async method to load pages. From my research, PhantomJS already lives in a separate thread and supports multiple tabs, so I believe the only missing...