For some reason when I run my tests at work the browser is maximized, but when I run them at home it only opens a browser window of about 50% width. This causes some discrepancies with scrolling down, etc., so I'd ideally like to have it open a browser window of the same size on every machine the tests are run on. What's the best way to do this?
(I've found some answers for other languages, but I haven't been able to adapt them to JavaScript)
Adding
browser.executeScript('window.moveTo(0,0);' +
'window.resizeTo(screen.width, screen.height);');
does nothing (apparently window.moveTo
and window.resizeTo
are not supported by Google Chrome).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…