Path: blob/trunk/py/selenium/webdriver/edge/webdriver.py
1864 views
# Licensed to the Software Freedom Conservancy (SFC) under one1# or more contributor license agreements. See the NOTICE file2# distributed with this work for additional information3# regarding copyright ownership. The SFC licenses this file4# to you under the Apache License, Version 2.0 (the5# "License"); you may not use this file except in compliance6# with the License. You may obtain a copy of the License at7#8# http://www.apache.org/licenses/LICENSE-2.09#10# Unless required by applicable law or agreed to in writing,11# software distributed under the License is distributed on an12# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY13# KIND, either express or implied. See the License for the14# specific language governing permissions and limitations15# under the License.1617from typing import Optional1819from selenium.webdriver.chromium.webdriver import ChromiumDriver20from selenium.webdriver.common.desired_capabilities import DesiredCapabilities2122from .options import Options23from .service import Service242526class WebDriver(ChromiumDriver):27"""Controls the MSEdgeDriver and allows you to drive the browser."""2829def __init__(30self,31options: Optional[Options] = None,32service: Optional[Service] = None,33keep_alive: bool = True,34) -> None:35"""Creates a new instance of the edge driver. Starts the service and36then creates new instance of edge driver.3738:Args:39- options - this takes an instance of EdgeOptions40- service - Service object for handling the browser driver if you need to pass extra details41- keep_alive - Whether to configure EdgeRemoteConnection to use HTTP keep-alive.42"""43service = service if service else Service()44options = options if options else Options()4546super().__init__(47browser_name=DesiredCapabilities.EDGE["browserName"],48vendor_prefix="ms",49options=options,50service=service,51keep_alive=keep_alive,52)535455