Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9153457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:16:31+00:00 2026-06-17T12:16:31+00:00

Our company wants to start triggering our QUnit unit tests through our CI server

  • 0

Our company wants to start triggering our QUnit unit tests through our CI server and are looking at PhantomJS as a means of achieving this goal. We started by just trying to open a couple of our QUnit test pages in phantom via the following script:

var page = require('webpage').create();
var args = require('system').args;

page.onConsoleMessage = function(msg, lineNum, sourceId) {
    console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")');
};
page.onError = function(msg, trace) {
    var msgStack = ['ERROR: ' + msg];
    if (trace) {
        msgStack.push('TRACE:');
        trace.forEach(function(t) {
            msgStack.push(' -> ' + t.file + ': ' + t.line + (t.function ? ' (in function "' + t.function + '")' : ''));
        });
    }
    console.error(msgStack.join('\n'));
};

page.open(args[1], function(status) {
    phantom.exit();
});

Nothing fancy, almost copied verbatim from the phantomJS reference pages. But alas, this sometimes results in the following output:

ERROR: SyntaxError: Parse error
TRACE:
ERROR: SyntaxError: Parse error
TRACE:
ERROR: SyntaxError: Parse error
TRACE:
ERROR: SyntaxError: Parse error
TRACE:

I’ve dug into it and the “parse error” is because PhantomJS thinks that the jQuery variable is uninitialized, but the thing is, the pages I am trying to load in PhantomJS work perfectly fine in Chrome, IE, and Firefox, so there is no parse error that I can see (the code to load jQuery is a boring SCRIPT tag at the top of the HEAD tag, so nothing exciting there).

If it makes any difference, our tests are inside ASP.NET (aspx) pages, served through either the VS2010 built in development server, IIS8 Express, or IIS 6. My next step is to turn them into pure HTML to see if phantom will still complain, but that’s not really a valid solution since loading up ASPX pages will be a requirement further down the line (to potentially do automated UI tests using Phantom).

Any ideas on what is wrong? Not sure what other pieces of information would be useful to debug this problem, but I will provide them as requested. I am stumped (especially since “parse error” isn’t exactly the most useful of error messages).

Edit:
This seems to be related to the following two WebKit issues:

  • https://bugreports.qt.io/browse/QTBUG-16022
  • https://bugs.webkit.org/show_bug.cgi?id=58727

If I turn off GZIP compression on our server it seems to work okay, but I still have to do further research into the issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:16:32+00:00Added an answer on June 17, 2026 at 12:16 pm

    This is a bug in PhantomJS: http://code.google.com/p/phantomjs/issues/detail?id=930&start=300

    The workaround is to turn off GZIP compression for now (or send bogus accept headers from Phantom to trick the server into not sending compressed content).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My company wants to start mobile web application development, as an addition to our
My company wants to start building mobile versions of our websites so we need
I have a server on our company intranet that runs JBoss. I want to
Our company has a share point document server where the UNC looks something like
In our company we were using this code (given at the end) for about
Our company wants to offer a plugin gallery or app store where users of
I am about to start a pilot project in our company to introduce agile
My company is about to start building the back-end for one of our new
What Delphi coding standards document(s) do you follow? Our company is looking at putting
The designer of our company wants me to give him the resolutions of Android

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.