Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 带有Python-driver.title参数的Selenium Webdriver_Python 2.7_Selenium_Selenium Webdriver_Parameters - Fatal编程技术网

Python 2.7 带有Python-driver.title参数的Selenium Webdriver

Python 2.7 带有Python-driver.title参数的Selenium Webdriver,python-2.7,selenium,selenium-webdriver,parameters,Python 2.7,Selenium,Selenium Webdriver,Parameters,我不熟悉Python和Selenium。如何派生driver.title参数?下面是一个简单的webdriver脚本您如何找到其他哪些driver.x参数可用于 我不知道你在问什么 其他驱动程序.x参数可以在或中找到 import unittest from selenium import webdriver from selenium.webdriver.common.keys import Keys class PythonOrgSearch(unittest.TestCase):

我不熟悉Python和Selenium。如何派生driver.title参数?下面是一个简单的webdriver脚本您如何找到其他哪些driver.x参数可用于


我不知道你在问什么

其他驱动程序.x参数可以在或中找到

import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

class PythonOrgSearch(unittest.TestCase):

    def setUp(self):
        self.driver = webdriver.Firefox()

    def test_search_in_python_org(self):
        driver = self.driver
        driver.get("http://www.python.org")
        self.assertIn("Python", driver.title)
        elem = driver.find_element_by_name("q")
        elem.send_keys("selenium")
        elem.send_keys(Keys.RETURN)
        self.assertIn("Google", driver.title)

    def tearDown(self):
        self.driver.close()

if __name__ == "__main__":
    unittest.main()
# Generally I found the following might be useful for verifying the page:
driver.current_url
driver.title

# The following might be useful for verifying the driver instance:
driver.name
driver.orientation
driver.page_source
driver.window_handles
driver.current_window_handle
driver.desired_capabilities