本文整理汇总了Python中selenium.test.selenium.webdriver.common.webserver.SimpleWebServer.start方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleWebServer.start方法的具体用法?Python SimpleWebServer.start怎么用?Python SimpleWebServer.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类selenium.test.selenium.webdriver.common.webserver.SimpleWebServer
的用法示例。
在下文中一共展示了SimpleWebServer.start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
def setup_module(module):
webserver = SimpleWebServer()
webserver.start()
FirefoxSelectElementHandlingTests.webserver = webserver
capabilities = {'marionette': False}
FirefoxSelectElementHandlingTests.driver = webdriver.Firefox(
capabilities=capabilities)
示例2: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
def setup_module(module):
utils.start_server(module)
webserver = SimpleWebServer()
webserver.start()
RemoteAdvancedUserInteractionTest.webserver = webserver
RemoteAdvancedUserInteractionTest.driver = \
webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.FIREFOX)
示例3: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
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
示例4: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
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")
示例5: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
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)
示例6: setup_method
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
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()
示例7: setup_method
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
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))
示例8: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
def setup_module(module):
webserver = SimpleWebServer()
webserver.start()
FirefoxSelectElementHandlingTests.webserver = webserver
FirefoxSelectElementHandlingTests.driver = webdriver.Firefox()
示例9: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
def setup_module(module):
utils.start_server(module)
webserver = SimpleWebServer()
webserver.start()
RemoteCookieTest.webserver = webserver
RemoteCookieTest.driver = webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.FIREFOX)
示例10: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
def setup_module(module):
webserver = SimpleWebServer()
webserver.start()
IeChildrenFindingTest.webserver = webserver
IeChildrenFindingTest.driver = webdriver.Ie()
示例11: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
def setup_module(module):
webserver = SimpleWebServer(host=get_lan_ip())
webserver.start()
FirefoxElementEqualityTests.webserver = webserver
FirefoxElementEqualityTests.driver = webdriver.Firefox()
示例12: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
def setup_module(module):
webserver = SimpleWebServer()
webserver.start()
IeExecutingAsyncJavaScriptTests.webserver = webserver
IeExecutingAsyncJavaScriptTests.driver = webdriver.Ie()
示例13: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
def setup_module(module):
utils.start_server(module)
webserver = SimpleWebServer()
webserver.start()
RemoteSelectElementHandlingTests.webserver = webserver
RemoteSelectElementHandlingTests.driver = webdriver.Remote(desired_capabilities = webdriver.DesiredCapabilities.FIREFOX)
示例14: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
def setup_module(module):
webserver = SimpleWebServer()
webserver.start()
FirefoxWebDriverWaitTest.webserver = webserver
FirefoxWebDriverWaitTest.driver = webdriver.Firefox()
示例15: setup_module
# 需要导入模块: from selenium.test.selenium.webdriver.common.webserver import SimpleWebServer [as 别名]
# 或者: from selenium.test.selenium.webdriver.common.webserver.SimpleWebServer import start [as 别名]
def setup_module(module):
webserver = SimpleWebServer()
webserver.start()
ChromeImplicitWaitTest.webserver = webserver
ChromeImplicitWaitTest.driver = webdriver.Chrome()