phantomjs

Change path for the logfile of PhantomJS in java

纵然是瞬间 提交于 2019-12-10 15:14:29
问题 I cannot figure out how I can change path for logfile for PhantomJS. I try with: DesiredCapabilities caps = new DesiredCapabilities(); caps.setJavascriptEnabled(true); caps.setCapability("takesScreenshot", false); caps.setCapability( PhantomJSDriverService.PHANTOMJS_GHOSTDRIVER_CLI_ARGS, new String[] { "--logfile=/home/ant/Document/phantomjsdriver.log" }); caps.setCapability( PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, path); And also with: ArrayList<String> cliArgsCap = new

QUnit on Travis CI (PhantomJS timeout)

此生再无相见时 提交于 2019-12-10 14:59:23
问题 Whenever I try to QUnit-Test on Travis the build fails with a PhantomJS Timeout Error. See: https://travis-ci.org/misantronic/frameWreck/builds/38939015 from line 86. On my local system everything just works fine. Its actually loading all the sources (QUnits.js and my js-module) but as soon as the test() function is invoked, it fails. I found some topics about this issue, but these were because of the grunt version number (<0.4). Thats not the case. 来源: https://stackoverflow.com/questions

Find PDF page count with Node (on Windows)

假如想象 提交于 2019-12-10 13:39:43
问题 I did a lot of research (I guess not enough?) and am trying to find an easy to use library to find the page count of a PDF using Node.js. The library would need to be usable on a Windows OS. Anyone know how best to approach this? Worst case situation, I was thinking about doing something with PhantomJS and the PDF.js library. Thanks for any help!! 回答1: Since it's built on pdf.js, pdf2json it should work in windows. I managed to find the page count of a test document like so: var PDFParser =

PhantomJS: “SyntaxError: Unexpected token =>”

倖福魔咒の 提交于 2019-12-10 13:33:50
问题 Im currently having problems using phantomJS. Any suggestions? acanyon$ babel-node source_parser.js http://url /Users/.../node/node_modules/phantom/lib/index.js:23 return new Promise(resolve => resolve(new _phantom2.default(args, config))); ^^ SyntaxError: Unexpected token => at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Module._extensions..js (module.js:478:10) at Object.require.extensions.(anonymous function) [as .js] (/Users/acanyon/.nvm/versions/node

Phantom js returns 'can't open [file name]' when trying to run example js file

倾然丶 夕夏残阳落幕 提交于 2019-12-10 13:29:13
问题 Environment: Windows 7, Phantomjs version 1.8.0. I try to run any .js file from 'examples' folder, installed Phantom.js before, added path to the PATH variable, checked version like phantomjs --version and it works. But when I try to run phantomjs examples/version.js then get 'Can't open version.js' I've checked file security settings and run cmd like administrator, but still the same result. I'll appreciate any help to solve this issue. Thanks in advance. 回答1: Was having the same trouble.

how we can use evaluateAsync in phantomjs

岁酱吖の 提交于 2019-12-10 13:26:31
问题 what's the usage of evaluateAsync and when we have to use this function and what's the benefit of using this function . in the below we see a poor documentation for this : var webPage = require('webpage'); var page = webPage.create(); // @TODO: Finish page.evaluateJavaScript example. any body can show a example of usage of evaluateAsync in phantomjs 回答1: This function allows you to execute any JavaScript code like the evaluate API function. But it will evaluate your code asynchronous. It

TeamCity: PhantomJS have not captured in 60000 ms, killing

蹲街弑〆低调 提交于 2019-12-10 13:18:56
问题 I'm encountering an issue when running tests in my CI environment. The configuration works fine on MacOS 10.11.6 (El Capitan), with Node v6.0.0 / npm 3.8.6, but on a TeamCity 9.1.6 agent running Windows with Node v4.2.2 / npm 2.14.7, it fails miserably with an error of PhantomJS have not captured in 60000 ms . Here's an example stacktrace on TeamCity: [08:58:40][exec] 02 11 2016 08:58:41.095:DEBUG [config]: autoWatch set to false, because of singleRun [08:58:40][exec] 02 11 2016 08:58:41.102

PhantomJS has crashed - Fatal Windows exception, code 0xc0000005

只谈情不闲聊 提交于 2019-12-10 13:15:23
问题 We have built a application using EmberJS. We got a failure message when we test the application using ember test . Here I mentioned the error message OS: Windows 8(64-bit) PhantomJS: 2.1.1 PhantomJS - error --- message: > Error: Non-zero exit code: 3221225477 Stderr: Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at <http://phantomjs.org/bug-reporting.html> and file a bug report. Log: | { type: 'error', text: 'Error: Browser exited

Phantomjs login, redirect and render page after pageLoad finishes

旧街凉风 提交于 2019-12-10 13:12:33
问题 I have a website with a login form. If a user is not logged and tries to access a internal page it will be redirected to the default page. For instance if I try to access http://siteURL.PhantomPrint.aspx I will be redirected to http://siteURL/Default.aspx?ReturnUrl=PhantomPrint.aspx. And after login an automatic redirect will take place to the page. After the redirect I want to render the page with Phantomjs and save it as pdf. The problem is that the rendering takes place before page load is

Closing a window.confirm in protractor with phantomJs

空扰寡人 提交于 2019-12-10 11:35:10
问题 I'm writing E2E tests with Protractor for my AngularJS app. At some point the browser will encounter a window.confirm . When using Chrome as the test browser, the following code works fine : var ptor = protractor.getInstance(); ptor.switchTo().alert().accept(); But on PhantomJS it raises the following error : UnknownError: Invalid Command Method ==== async task ==== WebDriver.switchTo().alert() at tests/E2E/spec/search.spec.js:73:33 ==== async task ==== Asynchronous test function: it() Error