Tuesday 27 November 2018

I Need Help With node-browserstack

EDIT: Even though I have an active account, my current plan does not support the Unlimited Screenshots via API. The error makes total sense. Duh.I can't seem to get node-browserstack to work.When I run node index.js I get Error: You do not have access to the API. Upgrade your plan to get access.I have an active Browserstack account.I have tried all combinations of username, email, password and access key.package.json{ "name": "screenshot", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "browserstack": "^1.5.1", "dotenv": "^6.1.0" } } index.jsrequire('dotenv').config(); var BrowserStack = require("browserstack"); var browserStackCredentials = { username: process.env.BROWSERSTACK_USERNAME, password: process.env.BROWSERSTACK_PASSWORD }; // Screenshots API var screenshotClient = BrowserStack.createScreenshotClient(browserStackCredentials); var options = { url: 'https://www.google.com/', browsers: [ { "os": "Windows", "os_version": "XP", "browser": "chrome", "browser_version": "21.0", "device": null }, { "os": "ios", "os_version": "6.0", "browser": "Mobile Safari", "browser_version": null, "device": "iPhone 4S (6.0)" } ] } screenshotClient.generateScreenshots(options, function(error,job){ if (error) { console.log('ERROR', error); return; } console.log(job); });

Submitted November 27, 2018 at 08:52PM by P013370

No comments:

Post a Comment