Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    marco.navarro +1
    Ashwini Kumar
    Hi all, need help in handling Popup Window using phantomjs
    Any suggestion is welcome
    Kevin Roulleau
    Hello, I would like to know if phantomjs shares localstorage accross various instances of the browser ?
        it(value.domain + ' should return all window handles', function () {
            windowHandles = browser.windowHandles()
        it(value.domain + ' should switch tab to Orion', function () {
        it(value.domain + ' should resize the Orion window to 1200 x 768 px', function () {
                width: 1200,
                height: 768
    its done by using webdriver.io, you need to find simmilar hooks on phantom, but this one for sure works
    Mihai A.
    Chrome 59 has been released recently. It can be run headlessly, which means it can replace phantomJS in automates UI tests with Selenium, for instance
    Mihai A.
    I wrote about configuring Chrome Headless with Selenium on Travis CI here: http://www.amihaiemil.com/2017/07/14/selenium-headless-chrome-travis.html
    var page = require('webpage').create();
    var system = require('system');
    page.onInitialized = function() {
        page.onCallback = function(data) {
            console.log('Main page is loaded and ready');
            //Do whatever here
        page.evaluate(function() {
            document.addEventListener('DOMContentLoaded', function() {
            }, false);
            console.log("Added listener to wait for page ready");
    page.open('https://vtopbeta.vit.ac.in/vtop/', function(status) {});
    phantomjs --ignore-ssl-errors=true index.js
    https://vtopbeta.vit.ac.in/vtop/ is not triggering the callback. please help me in this
    Hey. Someone here?
    Andrew Powell
    hey folks, wanted to share something I just published https://www.npmjs.com/package/mocha-chrome
    similar to mocha-phantomjs, but uses headless chrome via chrome-launcher, chrome-remote-interface, and sorcery
    Maggie Jones Savovska
    @shellscape: Thanks. Do you know how to install headless chrome on linux centos?
    Mihai A.
    @maggiesavovska it's chrome > v59. So just google how to install latest chrome
    Malay Ladu


    Is anyone using Manet with PhantomJS?

    dare-to-recurse Hello
    dare-to-recurse Does anyone know if it's possible to somehow specify which version of the pdf standard that phantomjs outputs? It seems to generate version 1.4, however we have a third party who require that the files we send them are using version 1.3.
    Does anyone have any suggestions as to what I could do to test a react app using phantomJS? When I run my tests using phantom they all fail but using chromeDriver works fine. It seems like pahntomJS doesn't support the react components and therefore it cannot see the site for testing.
    Mihai A.
    @danielgecko you could try headless chrome with selenium?
    @amihaiemil Thanks, that is what I ended up doing
    Hello, I just wanted to know if phantomjs has an available function so I can pre-process the file before being processed by phantomjs.
    I wanted to change from <script src="https://somecdn.com/app.js"></script> to <script src="http://localhost/app.js"></script>.

    Hello, I want to understand the following behaviour:
    I'm using phantomjs and selenium to render local html file
    such as file://path/to/index.html

    with index.thml


    why does
    (Pdb++) self.driver.page_source


    how can I prevent the driver to fill the page_source with `html head title body?


    Mihai A.
    I'm not sure it is possible? Since <head></head> is not a valid HTML document, I guess phantomJS automatically renders an empty, valid, HTML
    @amihaiemil Thanks for the reply
    Hi, any soultion to following issue?
    [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "myurl"
    Dustin Graves
    I am getting this issue:
    PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
      ReferenceError: Can't find variable: Map
      at webpack:///node_modules/chai-enzyme/build/index.js:93:0 <- tests/test-bundler.js:90992
    PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
      ReferenceError: Can't find variable: Map
      at webpack:///node_modules/chai-enzyme/build/index.js:93:0 <- tests/test-bundler.js:90992
    I have seen a few things about es6 shims but I haven't had any issues with this until recently
    @dustingraves I am not sure you are going to get a proper response (you can see the last post is over 4 months ago), this might have todo with PhantomJS being discontinued.
    Chromium supports headless now. (-->Puppeteer)
    Dustin Graves
    @Fifoo I was able to solve my problem 2 ways, 1 way is is importing Set and Map from core-js and the other is babel-polyfill.
    Thanks for the follow up
    The chromium things looks good though
    Hi, can anyone please helpme on how to turn off the interactive mode of the Phantomjs ?
    Hey guys, I'm trying to load some fonts into phantomjs for pdf creation. I'd appreciate if some of you pros would have a look at this: https://stackoverflow.com/questions/52868721/correct-path-for-font-src-url-in-phantomjs
    Gianina Vallejo
    Good day
    I would like to know how I can put a footer with phantom in sails.js
    I got this error

    TypeError: phantom.callback is not a function
    at C:\Users\gvallejo\Documents\GitHub\mib-api-zoho-crm\MIB_ZOHO_CRM\api\controllers\claims\generate-worksheet.js:113:23

    at process._tickDomainCallback (internal/process/next_tick.js:228:7)

    footer: {
    height: "3cm",
    contents: phantom.callback(
    function(pageNum, numPages) {
    return("Header: "+pageNum+"/"+numPages);
    Duc Le
    hi all quick question, I'm trying to loop thru multiple site but I can't seem to get it to work. Here is the snippet
    for(let i = 0; i < urls.length; i++) {
      var path = urls[i].domain + urls[i].path;  
      // request page
      page.open(path, function (status) {
        console.log('STATUS: ', status);
        if (status === 'success') {
          var plainText = page.plainText;
          // check if term exist on this page
        } else {
          console.log('page failed to load');
    phantomjs would just hang when I run this code

    I am using PhantomJS and Selenium Scala driver

    val submitBtn: WebElement = driver.findElement(By.xpath(".//*[@value=‘FOO']"))
    Failing at the line above

    Got this error

    "message": "'undefined' is not a function (evaluating '_getTagName(currWindow).toLowerCase()')"
    need help to troubleshoot this error- I am installing the PhantomJS in Kali Linux machine. Followed the step from this site: https://gist.github.com/julionc/7476620. Upon checking the version it gives me error.
    error screenshot.png
    I tried 3 methods- 1) added export openssl_config =/etc/ssl/ on line 20- with this method now I get the below error
    error screeshot_1.png