This article briefly describes how to get the location and size of the browser window, which describes how to set the location and size of the browser window through Webdriver.
Directly on the yards ...
1 /**2 * Set Browser size for expected setting3 * 4 * @authorAARON.FFP5 * @versionV1.0.0:autoseleniumdemo main.aaron.sele.core Seleniumcore.java setbrowsersize, 2015-7-28 01:18:19 Exp $6 * 7 * @paramwidth:browser Width8 * @paramHeight:browser Height9 */Ten Public voidSetbrowsersize (intWidthintheight) { One This. webdriver.manage (). window (). SetSize (NewDimension (width, height)); A } - - /** the * Set Browser position - * - * @authorAARON.FFP - * @versionV1.0.0:autoseleniumdemo main.aaron.sele.core Seleniumcore.java setbrowserposition, 2015-7-28 01:15:47 Exp $ + * - * @param Left + * @paramTop A */ at Public voidSetbrowserposition (intLeftinttop) { - This. webdriver.manage (). window (). SetPosition (NewPoint (left, top)); -}
Note This article and the previous 018-Get browser window position size the size of the browser is the size of the entire browser's window, not the size of the browser's page display area. If you are interested in the small master want to get the size of the display page, you can use the following general method of thinking to try to get (the subsequent blog post will also be updated, please look forward to).
At this point, theWebUI automation function test Script No. 019-Set the browser window position size Smooth end, hope this article can give beginners Selenium you a reference.
Finally, very grateful to the pro-stop, I hope this article can be pro helpful. Warmly welcome the kiss to discuss together and progress together. Thank you so much! ^_^
SELENIUM2 Learning -021-webui Automation Real instance -019-setting the browser window position size