当前位置: 首页>>代码示例>>Python>>正文


Python webserver.SimpleWebServer类代码示例

本文整理汇总了Python中selenium.test.selenium.webdriver.common.webserver.SimpleWebServer的典型用法代码示例。如果您正苦于以下问题:Python SimpleWebServer类的具体用法?Python SimpleWebServer怎么用?Python SimpleWebServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SimpleWebServer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup_module

def setup_module(module):
    webserver = SimpleWebServer()
    webserver.start()
    FirefoxSelectElementHandlingTests.webserver = webserver
    capabilities = {'marionette': False}
    FirefoxSelectElementHandlingTests.driver = webdriver.Firefox(
        capabilities=capabilities)
开发者ID:Alsan,项目名称:selenium,代码行数:7,代码来源:ff_select_support_class_tests.py

示例2: setup_module

def setup_module(module):
    utils.start_server(module)
    webserver = SimpleWebServer()
    webserver.start()
    RemoteAdvancedUserInteractionTest.webserver = webserver
    RemoteAdvancedUserInteractionTest.driver = \
        webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.FIREFOX)
开发者ID:chromium-googlesource-mirror,项目名称:selenium,代码行数:7,代码来源:test_remote_interactions.py

示例3: setup_module

def setup_module(module):
  _socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  url = "http://%s:%d/wd/hub" % (SERVER_ADDR, DEFAULT_PORT)
  try:
    _socket.connect((SERVER_ADDR, DEFAULT_PORT))
    print ("The remote driver server is already running or something else"
           "is using port %d, continuing..." % DEFAULT_PORT)
  except:
    print ("Starting the remote driver server")
    AuthenticatedServerTest.server_proc = subprocess.Popen(
        "java -jar build/java/server/test/org/openqa/selenium/remote/server/auth/server-standalone.jar",
        shell=True)
    assert wait_for_server(url, 10), "can't connect"
    print "Server should be online"
  
  webserver = SimpleWebServer()
  webserver.start()
  AuthenticatedServerTest.webserver = webserver
开发者ID:Hemkumar,项目名称:selenium,代码行数:18,代码来源:test_remote_authenticated_server.py

示例4: setup_module

def setup_module(module):
    _socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    url = "http://%s:%d/wd/hub" % (SERVER_ADDR, DEFAULT_PORT)
    try:
        _socket.connect((SERVER_ADDR, DEFAULT_PORT))
        print ("The remote driver server is already running or something else"
               "is using port %d, continuing..." % DEFAULT_PORT)
    except:
        print ("Starting the remote driver server")
        RemoteVisibilityTests.server_proc = subprocess.Popen(
            "java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar",
            shell=True)

        assert wait_for_server(url, 10), "can't connect"
        print "Server should be online"

    webserver = SimpleWebServer()
    webserver.start()
    RemoteVisibilityTests.webserver = webserver
    RemoteVisibilityTests.driver = webdriver.Remote(browser_name="firefox", platform="ANY")
开发者ID:PolicyStat,项目名称:selenium-old,代码行数:20,代码来源:test_remote_visibility_tests.py

示例5: setup_module

def setup_module(module):
    _socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    url = "http://%s:%d/wd/hub" % (SERVER_ADDR, DEFAULT_PORT)
    try:
        _socket.connect((SERVER_ADDR, DEFAULT_PORT))
        print ("The remote driver server is already running or something else"
               "is using port %d, continuing..." % DEFAULT_PORT)
    except:
        print ("Starting the remote driver server")
        RemoteTypingTests.server_proc = subprocess.Popen(
            "java -jar build/remote/server/server-standalone.jar",
            shell=True)

        assert wait_for_server(url, 10), "can't connect"
        print "Server should be online"

    webserver = SimpleWebServer()
    webserver.start()
    RemoteTypingTests.webserver = webserver
    RemoteTypingTests.driver = webdriver.Remote(desired_capabilities = webdriver.DesiredCapabilities.FIREFOX)
开发者ID:Escobita,项目名称:selenium,代码行数:20,代码来源:test_remote_typing_keys.py

示例6: setup_method

class TestOptions:

    def setup_method(self, method):
        self.webserver = SimpleWebServer()
        self.webserver.start()

    def test_we_can_pass_options(self):
        capabilities = {'marionette': True}
        options = Options()
        self.driver = webdriver.Firefox(
            capabilities=capabilities,
            firefox_options=options)
        self.driver.get(self.webserver.where_is('formPage.html'))
        self.driver.find_element_by_id("cheese")

    def teardown_method(self, method):
        try:
            self.driver.quit()
        except:
            pass  # Don't care since we may have killed the browser above
        self.webserver.stop()
开发者ID:AkosLukacs,项目名称:selenium,代码行数:21,代码来源:mn_options_tests.py

示例7: setup_method

class TestFirefoxProfile:
    
    def setup_method(self, method):
        self.driver = webdriver.Firefox() 
        self.webserver = SimpleWebServer()
        self.webserver.start()

    def test_that_we_can_accept_a_profile(self):
        self.profile1 = webdriver.FirefoxProfile()
        self.profile1.set_preference("startup.homepage_welcome_url", 
            "%s" % "http://localhost:%d/%s.html" % (self.webserver.port, "simpleTest"))
        self.profile1.update_preferences()

        self.profile2 = webdriver.FirefoxProfile(self.profile1.path)
        self.driver = webdriver.Firefox(firefox_profile=self.profile2)
        title = self.driver.title
        assert "Hello WebDriver" == title

    def test_that_we_delete_the_profile(self):
        path = self.driver.firefox_profile.path
        self.driver.quit()
        assert not os.path.exists(path)

    def teardown_method(self, method):
        try:
            self.driver.quit()
        except:
            pass #don't care since we may have killed the browser above
        self.webserver.stop()

    def _pageURL(self, name):
        return "http://localhost:%d/%s.html" % (self.webserver.port, name)

    def _loadSimplePage(self):
        self._loadPage("simpleTest")

    def _loadPage(self, name):
        self.driver.get(self._pageURL(name))
开发者ID:j0hnsmith,项目名称:Selenium2,代码行数:38,代码来源:test_ff_profile_tests.py

示例8: setup_module

def setup_module(module):
    webserver = SimpleWebServer()
    webserver.start()
    ChromeElementAttributeTests.webserver = webserver
    ChromeElementAttributeTests.driver = webdriver.Chrome()
开发者ID:Escobita,项目名称:selenium,代码行数:5,代码来源:test_chrome_element_attribute.py

示例9: setup_module

def setup_module(module):
    webserver = SimpleWebServer()
    webserver.start()
    FirefoxTypingTests.webserver = webserver
    FirefoxTypingTests.driver = webdriver.Firefox()
开发者ID:Escobita,项目名称:selenium,代码行数:5,代码来源:test_ff_typing_tests.py

示例10: setup_module

def setup_module(module):
    webserver = SimpleWebServer()
    webserver.start()
    FirefoxSelectElementHandlingTests.webserver = webserver
    FirefoxSelectElementHandlingTests.driver = webdriver.Firefox()
开发者ID:DreamYa0,项目名称:PythonProject,代码行数:5,代码来源:ff_select_support_class_tests.py

示例11: setup_module

def setup_module(module):
    webserver = SimpleWebServer()
    webserver.start()
    FirefoxWebDriverWaitTest.webserver = webserver
    FirefoxWebDriverWaitTest.driver = webdriver.Firefox()
开发者ID:chromium-googlesource-mirror,项目名称:selenium,代码行数:5,代码来源:ff_explicit_wait_tests.py

示例12: setup_module

def setup_module(module):
    
    webserver = SimpleWebServer(host=get_lan_ip())
    webserver.start()
    FirefoxStaleReferenceTests.webserver = webserver
    FirefoxStaleReferenceTests.driver = webdriver.Firefox()
开发者ID:RestoreDemocracy,项目名称:selenium-friends-scraper,代码行数:6,代码来源:ff_stale_reference_tests.py

示例13: setup_module

def setup_module(module):
    utils.start_server(module)
    webserver = SimpleWebServer()
    webserver.start()
    RemoteCookieTest.webserver = webserver
    RemoteCookieTest.driver = webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.FIREFOX)
开发者ID:chromium-googlesource-mirror,项目名称:selenium,代码行数:6,代码来源:test_remote_cookie.py

示例14: setup_module

def setup_module(module):
    webserver = SimpleWebServer()
    webserver.start()
    IeCorrectEventFiringTests.webserver = webserver
    IeCorrectEventFiringTests.driver = webdriver.Ie()
开发者ID:Escobita,项目名称:selenium,代码行数:5,代码来源:test_ie_correct_event_firing.py

示例15: setup_module

def setup_module(module):
    
    webserver = SimpleWebServer(host=get_lan_ip())
    webserver.start()
    FirefoxElementEqualityTests.webserver = webserver
    FirefoxElementEqualityTests.driver = webdriver.Firefox()
开发者ID:RestoreDemocracy,项目名称:selenium-friends-scraper,代码行数:6,代码来源:ff_element_equality_tests.py


注:本文中的selenium.test.selenium.webdriver.common.webserver.SimpleWebServer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。