Пример #1
0
    def get_size(self, driver: WebDriver = None):
        """
        获取屏幕大小
        :param driver:
        :return:
        """
        driver = driver or self.driver
        if not driver:
            return driver

        x = driver.get_window_size()['width']
        y = driver.get_window_size()['height']
        return [x, y]
Пример #2
0
 def __init__(self, driver: WebDriver):
     self.driver = driver
     self.Maximum = driver.get_window_size()
Пример #3
0
def getSize(driver: WebDriver):
    x = driver.get_window_size()['width']  # width为x坐标
    y = driver.get_window_size()['height']  # height为y坐标
    return (x, y)