Last active
September 28, 2015 14:39
-
-
Save tillsc/90e975a0b95ae18d3242 to your computer and use it in GitHub Desktop.
galen setup script tying to fix `clientWidth` in Browsers showing a vertical scrollbar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
// create driver and other stuff | |
// ... | |
driver.get(url); | |
var realWidth = inject(driver, 'return document.documentElement.clientWidth'); | |
if (realWidth < size.width) { | |
var w = 2 * size.width - realWidth; | |
console.log("clientWidth is " + realWidth + ". Correcting width to: " + w); | |
com.galenframework.utils.GalenUtils.resizeDriver(driver, "" + w + "x" + size.height); | |
console.log("fixed clientWidth: " + inject(driver, 'return document.documentElement.clientWidth')); | |
} | |
return driver; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment