How to get the Current window Size using Selenium Webdriver?

后端 未结 4 649
粉色の甜心
粉色の甜心 2021-01-12 20:25

I am running on Screen Resolution of (1366 X 768 ), but when I call getSize().getWidth() and getSize().getHeight() methods , the result I\'m gettin

4条回答
  •  粉色の甜心
    2021-01-12 21:08

    For python selenium webdriver use function get_window_size:

    driver.get_window_size()
    """
    Output:
    {
      "width": 1255,
      "height": 847,
      "hCode": 939524096,
      "class": "org.openqa.selenium.Dimension"
    }
    """
    

提交回复
热议问题