![]() ![]() ![]() Alternatively, Ruby binding has provided a _to() method, which is equivalent to #size=, but accepts width and height arguments according to API here.Įnvironment Tested: Mac OS Sierra, Ruby 2.3.1p112, Selenium 3.0.5, ChromDriver 2.26, GeckoDriver 0.13 Firefox 50.1, Chrome 55, PhantomJS 1.9.8 Example require 'selenium-webdriver' # get initial window size driver = Selenium :: WebDriver. To resize a window, one solution is to create a new Dimension object and assign it to property. In Ruby binding, window size can be retrieved from method, which is a type of struct Selenium::WebDriver::Dimension defined here. ![]() Below shows the examples on how to achieve this in Selenium WebDriver C#, Ruby and Python bindings. Selenium WebDriver supports getting the browser window size, resizing and maximizing window natively from its API, no JavaScript injections like window.resizeTo(X, Y) are necessary any more. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |