phantomjs

I can't make Highcharts phantomJs export server work

十年热恋 提交于 2019-12-09 11:10:44
问题 Big thanks in advance. I want to set up a phantomjs Highcharts export server. It should accept json options as input and output jpeg image files. Here is what I do: I download server side js code from this repo: https://github.com/highslide-software/highcharts.com/tree/master/exporting-server/phantomjs I download phantomjs 1.6.0 run phantomjs highcharts-convert.js -host 127.0.0.1 -port 3001 Then I tried to use client code in this site: http://export.highcharts.com/demo to send request. I

How to debug PhantomJS when running through Karma

自作多情 提交于 2019-12-09 04:37:39
问题 I test through Jasmine, Karma and a variety of browsers. I'm currently debugging a test that fails only in PhantomJS. I'd like to debug this call, so I've setup a custom PhantomJS launcher in karma that runs it with the debug port open. I'm able to access the remote debugger in Chrome through that port, however, it seems to know nothing about any of my test files. It reports an "about:blank" and a "localhost:9876" (the karma server that Phantom is hitting) but when I try to debug that

Can not download html with phantomjs [closed]

我是研究僧i 提交于 2019-12-09 03:58:36
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I have 3 different files in my project and the layout is phantomjs -->phantomjs.js -->phantomjs.exe index.php index.php: $phantom_script = dirname(__FILE__). '\phantomjs\phantomjs.js'; $response = exec ('\phantomjs\phantomjs.exe' . $phantom_script); echo $response; phantomjs\phantomjs.js var

PhantomJS not persisting localStorage consistently

北城余情 提交于 2019-12-09 03:41:40
问题 I am trying to make an isolated test case to experiment with PhantomJS localStorage behavior, but in my testCase, localStorage does not appear to be persistent. Here is the PhantomJS script: var page = require('webpage').create(); page.open('http://localhost:8080/myapp/test.html', function() { var x; x = page.evaluate(function() { return localStorage.getItem("foo"); }); console.log(x); phantom.exit(); }); When test.html has a call to localStorage.setItem("foo", "bar") the script displays "bar

Unsafe javascript attempt to access frame when installing casperjs through npm windows

筅森魡賤 提交于 2019-12-09 03:15:45
问题 I have installed casperjs and phantomjs on my windows machina via npm. However I get this issue. C:\>casperjs sample.js C:\>Unable to open file: sample.js Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file:///C:/Users/vini/AppData/Roaming/npm/node_modules/casperjs/bin/bootstrap.js. Domains, protocols and ports must match. 回答1: This is a known issue with CasperJS and the 1.9.8 version of PhantomJS. It doesn't do anything and the errors are only printed

How to take a snapshot of a section of a web page from the shell?

纵饮孤独 提交于 2019-12-08 23:13:11
问题 I have a section of a web page that I need to take a gif snapshot of at a given time interval. The snapshot needs to be full page size resolution, however as I said, it only goes to a certain place on the page (in this case it's after a table). What would be the best way to grab a page snapshot image image like this? I'd like to just throw it into a cron job and forget it, but I'm not readily seeing a tool that would make quick work of this. SOLUTION: As per the @Eduardo's excellent direction

List child elements for a Capybara/Poltergeist element

▼魔方 西西 提交于 2019-12-08 21:13:57
问题 I've searched around and I can't find a way to do this. We are running Capybara tests with the Poltergeist driver in cucumber features on an EmberJS/Rails app. I can't use page.driver.debug because I'm running inside a headless vagrant instance, so that troubleshooting is not available to me, but screenshots work, and a Chrome dev tools inspect on the page in question shows the right elements. I have a cucumber scenario that's failing, and it's because the find isn't working. My test looks

Testing React Apps with Phantom/Casper

烂漫一生 提交于 2019-12-08 19:42:35
I'm diving into functional testing and attempting to get a few simple tasks working. The app is built in ReactJS and I've decided to use Phantom/Casper. The problem is that even the most basic tasks fail. In short, is there a trick for testing React apps with Phantom/Casper? I've installed Phantom (v.2.1.1) and Casper (v1.1.0-beta5). As a first attempt I created a simple script to capture an image: capture.js var casper = require('casper').create({ viewportSize: { width: 1024, height: 768 }, verbose: true, logLevel: "debug" }); casper.start('http://localhost:9494', function() { console.log(

Iterating over a grid with CasperJS

非 Y 不嫁゛ 提交于 2019-12-08 19:41:49
问题 I am trying to test CasperJS out, and are scraping a site which has a grid layout like: |Name |Name | |Title |Title | |Image |Image | |Something |Something | |---------------------- |Name |Name | |Title |Title | |Image |Image | |Something |Something | |---------------------- If I wasn't using CasperJS I would retrieve a list of all the contains (4 i this case) and then run a method on each container which could retrieve an object with the wanted properties. I just seem to have a hard time of

Phantomjs installation for Windows [closed]

混江龙づ霸主 提交于 2019-12-08 19:10:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I downloaded the "phantomjs-1.7.0-windows.zip " for Windows from here. I even set up the path of the extracted folder in the environment variables. But I am getting the "parse error" when I try to enter any command like phantomjs --version in the phantomjs.exe command prompt. (My Windows is 64 bit.) Why is it