webdrivercss icon indicating copy to clipboard operation
webdrivercss copied to clipboard

Cannot read property 'documentWidth' of null

Open SerkanSipahi opened this issue 10 years ago • 1 comments

We use browserstack to test our webapp ! I think there are problems with android devices ! The response object does not contain the property what the script /node_modules/webdrivercss/lib/documentScreenshot.js excepted( see below error part ). What's going wrong?

no problems on iOS :)

Devices
'browserName' : 'android', 
'platform' : 'ANDROID',
'device' : 'HTC One M8'
'browserName' : 'android', 
'platform' : 'ANDROID', 
'device' : 'Samsung Galaxy S4'
browserName: 'android', 
platform: 'ANDROID', 
device: 'Samsung Galaxy S5'
'browserstack.local': true,
'browserName' : 'android',
'platform' : 'ANDROID',
'device' : 'Google Nexus 9'
Error
/srv/node_modules/webdrivercss/lib/documentScreenshot.js:131
                    return (currentXPos < (response.execute[0].value.documentW
                                                                    ^
TypeError: Cannot read property 'documentWidth' of null
Test-Script
var webdriverio = require('webdriverio'),
    webdrivercss = require('webdrivercss'),
    client = webdriverio.remote({
        host: 'hub.browserstack.com',
        port: 80,
        user : 'xxxxxxx',
        key: 'xxxxxx',
        logLevel: 'silent',
        desiredCapabilities: {
            'browserstack.local': true,
            'browserName' : 'android',
            'platform' : 'ANDROID',
            'device' : 'Samsung Galaxy S4'
        }
    });


webdrivercss.init(client)

client
    .init()
    .url('https://www.cu-camper.com')
    .getTitle(function(error, title) {
        console.log('Title was: ' + title);
    })
    .webdrivercss('startpage', {
        name: 'main-wrapper',
        elem: '.main-wrapper'
    })
    .getCssProperty('#footer', 'color', function(err, color) {
        console.log(color);
    })
    .end();

related issue https://github.com/webdriverio/webdrivercss/issues/32

SerkanSipahi avatar Mar 03 '15 09:03 SerkanSipahi

+1 using the actual devices ist the major benefit of selenium. otherwise is could just stick to phantomjs :/

martinkr avatar May 07 '15 10:05 martinkr