SELENIUM2 Learning -021-webui Automation Real instance -019-setting the browser window position size

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.