I'm trying to run the same test for two different browsers using node.js + selenium-webdriver + browserstack, but I'm getting the next error:
<--- Last few GCs --->
41891 ms: Scavenge 2000.5 (2066.8) -> 2000.5 (2066.8) MB, 3.7 / 0 ms (+ 1.7 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
43495 ms: Mark-sweep 2000.5 (2066.8) -> 2000.4 (2066.8) MB, 1603.9 / 0 ms (+ 2.9 ms in 2 steps since start of marking, biggest step 1.7 ms) [last resort gc].
45094 ms: Mark-sweep 2000.4 (2066.8) -> 2000.4 (2066.8) MB, 1598.7 / 0 ms [last resort gc].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x2d02b4ee3ac1 <JS Object>
1: isNative(aka CallSiteIsNative) [native messages.js:421] [pc=0x39994742f79b] (this=0x3fdf368d2a81 <a CallSite with map 0x39c7e8ee9e71>)
2: toString(aka CallSiteToString) [native messages.js:435] [pc=0x39994742eead] (this=0x3fdf368d2a81 <a CallSite with map 0x39c7e8ee9e71>)
3: FormatStackTrace(aka FormatStackTrace) [native messages.js:591] [pc=0x39994742dcb7] (this=0x2d02b4e04189 <...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
The code:
var webdriver = require('selenium-webdriver');
var fs = require('fs');
// Input capabilities
var capabilitiesIPhone = {
'browserstack.user' : 'XXXX',
'browserstack.key' : 'XXXXXX',
'browserName' : 'iPhone',
'platform' : 'MAC',
'device' : 'iPhone 5'
}
var driverIPhone = new webdriver.Builder().
usingServer('http://ift.tt/1xLqeX2').
withCapabilities(capabilitiesIPhone).
build();
driverIPhone.get('http://www.google.com');
//driver.findElement(webdriver.By.name('q')).sendKeys('BrowserStack');
//driver.findElement(webdriver.By.name('btnG')).click();
driverIPhone.getTitle().then(function(title) {
console.log(title);
});
driverIPhone.takeScreenshot().then(function(data) {
fs.writeFile('snapshotIPhone.jpg', data.replace(/^data:image\/png;base64,/,''), 'base64', function(err) {
if(err) throw err;
});
});
driverIPhone.quit();
// Input capabilities
var capabilitiesFX = {
'browserName' : 'firefox',
'browserstack.user' : 'XXXXX',
'browserstack.key' : 'XXXXX'
var driverFX = new webdriver.Builder().
usingServer('http://ift.tt/1xLqeX2').
withCapabilities(capabilitiesFX).
build();
driverFX.get(driverFX, 'http://www.google.com');
//driver.findElement(webdriver.By.name('q')).sendKeys('BrowserStack');
//driver.findElement(webdriver.By.name('btnG')).click();
driverFX.getTitle().then(function(title) {
console.log(title);
});
driverFX.takeScreenshot().then(function(data) {
fs.writeFile('snapshotFX.png', data.replace(/^data:image\/png;base64,/,''), 'base64', function(err) {
if(err) throw err;
});
});
driverFX.quit();
What am I doing wrong?
Aucun commentaire:
Enregistrer un commentaire