• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python expected_conditions.title_is函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_login_success

    def test_login_success(self):
        self.browser1 = webdriver.Firefox()
        self.browser2 = webdriver.Firefox()

        for i in range(100):
            # Step 1: Open the homepage of the installation
            self.browser1.get(url)
            self.browser2.get(url)

            # Step 2: Enter the username and the password in the login box
            loginpage1 = LoginPage(self.browser1)
            loginpage2 = LoginPage(self.browser2)
            loginpage1.login(user, password)
            loginpage2.login(user, password)

            # Step 3: Assert that the login is sucessful
            h1_1 = self.browser1.find_element_by_tag_name('h1')
            self.assertIn('Welcome', h1_1.text)
            h1_2 = self.browser2.find_element_by_tag_name('h1')
            self.assertIn('Welcome', h1_2.text)

            # Step 4: Logout
            self.browser1.get(url+"/identity/logout")
            self.browser2.get(url+"/identity/logout")

            wait = WebDriverWait(self.browser1, 10)
            wait.until(EC.title_is('Gluu'))
            wait = WebDriverWait(self.browser2, 10)
            wait.until(EC.title_is('Gluu'))

        self.browser1.quit()
        self.browser2.quit()
开发者ID:GluuFederation,项目名称:acceptance-tests,代码行数:32,代码来源:test_login.py


示例2: test_browser_navigation

    def test_browser_navigation(self):
        #driver = self.driver
        # get the search textbox
        search_field = self.driver.find_element_by_name('q')
        search_field.clear()

        # enter search keyword and submit
        search_field.send_keys('selenium webdriver')
        search_field.submit()

        se_wd_link = self.driver.find_element_by_link_text('Selenium WebDriver')
        se_wd_link.click()
        self.assertTrue(WebDriverWait(self.driver, 10)
                        .until(EC.title_is('Selenium WebDriver')))

        self.driver.back()
        self.assertTrue(WebDriverWait(self.driver, 10)
                        .until(EC.title_contains('selenium webdriver - ')))

        self.driver.forward()
        self.assertTrue(WebDriverWait(self.driver, 10)
                        .until(EC.title_is('Selenium WebDriver')))

        self.driver.refresh()
        self.assertTrue(WebDriverWait(self.driver, 10)
                        .until(EC.title_is('Selenium WebDriver')))
开发者ID:boldirev77,项目名称:selenium_tests,代码行数:26,代码来源:ch_4_googling.py


示例3: testBrowserNavigation

    def testBrowserNavigation(self):
        driver = self.driver
    # get the search textbox
        search_field = driver.find_element_by_name("q")
        search_field.clear()

    # enter search keyword and submit
        search_field.send_keys("selenium webdriver")
        search_field.submit();
        print("submittt...")

        se_wd_link = driver.find_element_by_link_text("Selenium WebDriver")
        se_wd_link.click()
        #self.assertEqual("selenium webdriver - Szukaj w Google", driver.title)

        
        print("do tyluu...")
        driver.back()
        self.assertTrue(WebDriverWait(self.driver, 10).until(expected_conditions.title_is("selenium webdriver - Szukaj w Google")))
        print("teraz do przodu")
        
        driver.forward()
        self.assertTrue(WebDriverWait(self.driver, 10).until(expected_conditions.title_is("Selenium WebDriver")))
        
        print("bedzie refresh")
        driver.refresh()
        self.assertTrue(WebDriverWait(self.driver, 10).until(expected_conditions.title_is("Selenium WebDriver")))
开发者ID:KamilZiemski,项目名称:pyDev,代码行数:27,代码来源:NavigationTest.py


示例4: test_login_and_edit

    def test_login_and_edit(self):
        self.driver.get(self.base + "/Fedora_Project_Wiki")
        assert title_is(self.title), self.driver.title
        elem = self.driver.find_element_by_id("pt-login")
        elem.click()

        assert title_is("Log in - " + self.title), self.driver.title
        elem = self.driver.find_element_by_id("wpName1")
        elem.send_keys(self.auth[0])
        elem = self.driver.find_element_by_id("wpPassword1")
        elem.send_keys(self.auth[1])
        elem = self.driver.find_element_by_id("wpLoginAttempt")
        elem.submit()

        assert title_is(self.title), self.driver.title

        self.driver.get(
            "https://stg.fedoraproject.org/wiki/Rube_Test_Page")
        elem = self.driver.find_element_by_id("ca-edit")
        elem.click()

        elem = self.driver.find_element_by_id("wpTextbox1")
        elem.send_keys(Keys.PAGE_DOWN)
        tag = str(uuid.uuid4())
        s = "Test comment from Rube\n%s" % tag
        elem.send_keys(s)
        elem = self.driver.find_element_by_id("wpSave")
        elem.submit()

        self.wait_for(tag)
开发者ID:fedora-infra,项目名称:rube,代码行数:30,代码来源:test_wiki.py


示例5: add_a_new_facility

    def add_a_new_facility(self, facility):
        self.go_to_facilities()
        self.wait.until(EC.title_is('Facilities'))
        link = self.wait.until(EC.presence_of_element_located(
            (By.ID, 'id_add_new_facility_link')))
        link.click()
        self.wait.until(EC.title_is('Add New Facility'))
        inputbox = self.wait.until(
            EC.presence_of_element_located((By.ID, 'id_facility_name')))
        inputbox.send_keys(facility.name)
        self.browser.find_element_by_xpath(
            '//select[@id="id_facility_type"]/option[text()="%s"]' %
            facility.type).click()
        inputbox = self.wait.until(
            EC.presence_of_element_located((By.ID, 'id_facility_status')))
        inputbox.send_keys(facility.status)
        if facility.area:
            select = Select(self.browser.find_element_by_id('id_facility_area'))
            select.select_by_visible_text(unicode(facility.area))
        if facility.json:
            inputbox = self.wait.until(
                EC.presence_of_element_located((By.ID, 'id_json')))
            inputbox.send_keys(facility.json)

        submit = self.browser.find_element_by_id('id_submit_button')
        submit.click()
        self.wait.until(EC.title_is('Facilities'))
开发者ID:triquetra011,项目名称:eha-facility-management,代码行数:27,代码来源:mdg_importer.py


示例6: test_login_and_edit_account

    def test_login_and_edit_account(self):
        self.driver.get(self.base)
        assert title_is(self.title), self.driver.title
        elem = self.driver.find_element_by_link_text("Log In")
        elem.click()

        title = "Login to the Fedora Accounts System"
        assert title_is(title), self.driver.title
        elem = self.driver.find_element_by_name("user_name")
        elem.send_keys(self.auth[0])
        elem = self.driver.find_element_by_name("password")
        elem.send_keys(self.auth[1])
        elem = self.driver.find_element_by_name("login")
        elem.send_keys(Keys.ENTER)

        title = "Fedora Accounts System"
        assert title_is(title), self.driver.title

        elem = self.driver.find_element_by_link_text("My Account")
        elem.click()

        elem = self.driver.find_element_by_link_text("(edit)")
        elem.click()

        elem = self.driver.find_element_by_name("comments")
        elem.send_keys(Keys.PAGE_DOWN)
        tag = str(uuid.uuid4())
        s = "Test comment from Rube\n%s" % tag
        elem.send_keys(s)
        elem = self.driver.find_element_by_xpath(
            "/html/body/div/div[4]/div[2]/form/div[15]/input")
        elem.submit()

        self.wait_for(tag)
开发者ID:fedora-infra,项目名称:rube,代码行数:34,代码来源:test_fas.py


示例7: test_9dReport

 def test_9dReport(self):
     report = driver.find_element_by_link_text("Отчёты")
     report.click()
     time.sleep(1)
     # Отчёт по контрольным точкам
     report1 = driver.find_element_by_link_text("Отчёт по контрольным точкам")
     report1.click()
     title = wait.until(EC.title_is('ЭОР - Report'))
     assert "500" not in driver.title  # проверка на 500/404 ошибку
     assert "404" not in driver.title
     _ = wait.until(EC.element_to_be_clickable((By.ID, 'load_table')))
     assert "500" not in driver.title  # проверка на 500/404 ошибку
     assert "404" not in driver.title
     # Отчёт Проект Расписания
     schedule = driver.find_element_by_link_text('Отчёт Проект Расписания')
     schedule.click()
     _ = wait.until(EC.element_to_be_clickable((By.CLASS_NAME, 'title_gears')))
     title = wait.until(EC.title_is('ЭОР - Schedule'))
     assert "500" not in driver.title  # проверка на 500/404 ошибку
     assert "404" not in driver.title
     assert "ЭОР - Schedule" in driver.title
     # Отчёт Рейтинги
     rating = driver.find_element_by_link_text('Отчёт Рейтинги')
     rating.click()
     _ = wait.until(EC.element_to_be_clickable((By.CLASS_NAME, 'title_gears')))
     title = wait.until(EC.title_is('ЭОР - Rating'))
     assert "500" not in driver.title  # проверка на 500/404 ошибку
     assert "404" not in driver.title
     assert "ЭОР - Rating" in driver.title
开发者ID:MaximSidorkin,项目名称:sysProj,代码行数:29,代码来源:Check500404_test.py


示例8: test_browser_navigation

    def test_browser_navigation(self):
        driver = self.driver
        # get the search textbox
        search_field = driver.find_element_by_name("q")
        search_field.clear()

        # enter search keyword and submit
        search_field.send_keys("selenium webdriver")
        search_field.submit()

        se_wd_link = driver. \
            find_element_by_link_text("Selenium WebDriver")
        se_wd_link.click()
        self.assertEqual("Selenium WebDriver", driver.title)

        driver.back()
        self.assertTrue(WebDriverWait(self.driver, 10)
                        .until(expected_conditions.title_is("selenium webdriver - Google Search")))

        driver.forward()
        self.assertTrue(WebDriverWait(self.driver, 10)
                        .until(expected_conditions.title_is("Selenium WebDriver")))

        driver.refresh()
        self.assertTrue(WebDriverWait(self.driver, 10)
                        .until(expected_conditions.title_is("Selenium WebDriver")))
开发者ID:Yogeshkalbhore,项目名称:Python,代码行数:26,代码来源:navigation_test.py


示例9: testExpectedConditionTitleIs

 def testExpectedConditionTitleIs(self, driver, pages):
     pages.load("blank.html")
     WebDriverWait(driver, 1).until(EC.title_is("blank"))
     driver.execute_script("setTimeout(function(){document.title='not blank'}, 200)")
     WebDriverWait(driver, 1).until(EC.title_is("not blank"))
     assert driver.title == 'not blank'
     with pytest.raises(TimeoutException):
         WebDriverWait(driver, 0.7).until(EC.title_is("blank"))
开发者ID:zhjwpku,项目名称:selenium,代码行数:8,代码来源:webdriverwait_tests.py


示例10: test_task_D5

 def test_task_D5(self):
     # I want to display a view of my claim when I click on it in the list
     self._login_user()
     WebDriverWait(self.browser, 10).until(ec.presence_of_element_located((By.ID, 'view_claims_button')))
     self.browser.find_element_by_id('view_claims_button').click()
     WebDriverWait(self.browser, 10).until(ec.title_is('Claims View'))
     WebDriverWait(self.browser, 10).until(ec.presence_of_element_located((By.CLASS_NAME, 'clickable-row')))
     self.browser.find_element_by_class_name('clickable-row').click()
     WebDriverWait(self.browser, 10).until(ec.title_is('View Claim'))
开发者ID:brendanoates,项目名称:employeeTimeRecorder,代码行数:9,代码来源:test_task_stories.py


示例11: testExpectedConditionTitleIs

 def testExpectedConditionTitleIs(self, driver, pages):
     if driver.capabilities['browserName'] == 'firefox' and driver.w3c:
         pytest.xfail("Marionette issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1297551")
     pages.load("blank.html")
     WebDriverWait(driver, 1).until(EC.title_is("blank"))
     driver.execute_script("setTimeout(function(){document.title='not blank'}, 200)")
     WebDriverWait(driver, 1).until(EC.title_is("not blank"))
     assert driver.title == 'not blank'
     with pytest.raises(TimeoutException):
         WebDriverWait(driver, 0.7).until(EC.title_is("blank"))
开发者ID:glib-briia,项目名称:selenium,代码行数:10,代码来源:webdriverwait_tests.py


示例12: test_login

 def test_login(self):
   from selenium.common.exceptions import TimeoutException
   dbHelp.create_test_user_using_default_values()
   self.loginEmail.send_keys("[email protected]")
   self.loginPw.send_keys("123456")
   self.loginButton.click()
   WebDriverWait(self.driver,10).until(EC.title_is("Space Habit Frontier!"))
   self.assertEqual(self.driver.title,"Space Habit Frontier!")
   self.driver.get("http://127.0.0.1:8080/login")
   self.assertRaises(TimeoutException,lambda :WebDriverWait(self.driver,5).until(EC.title_is("Login to Space Habit Frontier")))
开发者ID:joelliusp,项目名称:SpaceHabit,代码行数:10,代码来源:LoginSaveNewUser.py


示例13: test_task_D8

 def test_task_D8(self):
     # I want to be able to delete a claim
     self._login_user()
     WebDriverWait(self.browser, 10).until(ec.presence_of_element_located((By.ID, 'view_claims_button')))
     self.browser.find_element_by_id('view_claims_button').click()
     WebDriverWait(self.browser, 10).until(ec.title_is('Claims View'))
     self.browser.find_element_by_class_name('clickable-row').click()
     WebDriverWait(self.browser, 10).until(ec.title_is('View Claim'))
     self.browser.find_element_by_id('id_delete_claim_button').click()
     WebDriverWait(self.browser, 10).until(ec.title_is('Home'))
开发者ID:brendanoates,项目名称:employeeTimeRecorder,代码行数:10,代码来源:test_task_stories.py


示例14: testExpectedConditionTitleIs

 def testExpectedConditionTitleIs(self):
     self._loadPage("blank")
     WebDriverWait(self.driver, 1).until(EC.title_is("blank"))
     self.driver.execute_script("setTimeout(function(){document.title='not blank'}, 200)")
     WebDriverWait(self.driver, 1).until(EC.title_is("not blank"))
     self.assertEqual(self.driver.title, 'not blank')
     try:
         WebDriverWait(self.driver, 0.7).until(EC.title_is("blank"))
         self.fail("Expected TimeoutException to have been thrown")
     except TimeoutException as e:
         pass
开发者ID:NextGenIntelligence,项目名称:selenium,代码行数:11,代码来源:webdriverwait_tests.py


示例15: testTitleEn

 def testTitleEn(self):
     driver = self.driver
     driver.get(self.address)
     elementTitle = WebDriverWait(driver, 10).until(
         EC.title_is(u'Денисенко Денис')
     )
     eButtonEn = driver.find_element(By.XPATH, '//div[@class="block border indent header"]/div/a[@href="#en"]')
     eButtonEn.send_keys(Keys.ENTER)
     elementTitle = WebDriverWait(driver, 10).until(
         EC.title_is(u'Denisenko Denis')
     )
     driver.close()
开发者ID:denisenkodenis,项目名称:cv,代码行数:12,代码来源:GuiTests.py


示例16: test_task_C7

 def test_task_C7(self):
     # test_profile_update
     # Task C7.	As a logged in user I want to be able to change my staff number and managers email
     self._login_user()
     self.browser.find_element_by_id('id_account').click()
     self.assertTrue(WebDriverWait(self.browser, 10).until(ec.title_is('Profile')))
     self.browser.find_element_by_id('id_staff_number').send_keys('54321')
     action_chains = ActionChains(self.browser)
     action_chains.double_click(self.browser.find_element_by_id('id_manager_email')).perform()
     self.browser.find_element_by_id('id_manager_email').send_keys(MANAGER2)
     self.browser.find_element_by_id('update_profile_button').click()
     self.assertTrue(WebDriverWait(self.browser, 10).until(ec.title_is('Home')))
开发者ID:brendanoates,项目名称:employeeTimeRecorder,代码行数:12,代码来源:test_task_stories.py


示例17: test_taskb_story3

 def test_taskb_story3(self):
     # Task b Story 3
     # As a normal user I want log into the system but not be able to access the admin section
     self.browser.get('{}{}'.format(self.live_server_url, '/admin/login/'))
     self.assertTrue(WebDriverWait(self.browser, 10).until(ec.title_is('Log in | Django site admin')))
     user_id = self.browser.find_element_by_id('id_username')
     user_password = self.browser.find_element_by_id('id_password')
     user_id.send_keys(USER1)
     user_password.send_keys(PASSWORD)
     user_password.send_keys(Keys.ENTER)
     self.assertTrue(WebDriverWait(self.browser, 10).until(ec.title_is('Log in | Django site admin')))
     self.browser.get('{}{}'.format(self.live_server_url, '/admin/logout/'))
开发者ID:brendanoates,项目名称:employeeTimeRecorder,代码行数:12,代码来源:test_task_stories.py


示例18: test_amvr

 def test_amvr(self): 
     driver = self.driver
     waiting = self.waiting
     
     driver.get("https://apps.tn.gov/amvr-app/login.html")
     
     waiting.until(expected_conditions.title_is("Log In - Motor Vehicle Records Search"))
     username_textbox = waiting.until(expected_conditions.visibility_of(driver.find_element_by_id("username")))
     password_textbox = waiting.until(expected_conditions.visibility_of(driver.find_element_by_id("password")))
     login_button = waiting.until(expected_conditions.visibility_of(driver.find_element_by_name("login")))
     
     waiting.until(expected_conditions.title_is("Log In - Motor Vehicle Records Search"))
     self.assertIn("amvr-app/login.html", driver.current_url, "Failed to login")
开发者ID:shawnknight,项目名称:test_project,代码行数:13,代码来源:amvr_test.py


示例19: test_task_C6

 def test_task_C6(self):
     # Task C story 6
     # As a registered staff user I want to be able to log in and access the admin backend
     self.browser.get('{}{}'.format(self.live_server_url, ''))
     self.assertTrue(WebDriverWait(self.browser, 10).until(ec.title_is('Login')))
     user_id = self.browser.find_element_by_id('id_username')
     user_password = self.browser.find_element_by_id('id_password')
     user_id.send_keys(HR_USER)
     user_password.send_keys(PASSWORD)
     user_password.send_keys(Keys.ENTER)
     self.assertTrue(WebDriverWait(self.browser, 10).until(ec.title_is('Home')))
     self.browser.find_element_by_id('id_admin').click()
     self.assertTrue(WebDriverWait(self.browser, 10).until(ec.title_is('Site administration | Django site admin')))
开发者ID:brendanoates,项目名称:employeeTimeRecorder,代码行数:13,代码来源:test_task_stories.py


示例20: test_taskb_story2

 def test_taskb_story2(self):
     # Task b Story 2
     # As a super user I want log into the system and access the admin section of the project
     self.browser.get('{}{}'.format(self.live_server_url, '/admin/login/'))
     self.assertTrue(WebDriverWait(self.browser, 10).until(ec.title_is('Log in | Django site admin')))
     user_id = self.browser.find_element_by_id('id_username')
     user_password = self.browser.find_element_by_id('id_password')
     user_id.send_keys(SUPER_USER)
     user_password.send_keys(PASSWORD)
     user_password.send_keys(Keys.ENTER)
     self.assertTrue(WebDriverWait(self.browser, 10).until(ec.title_is('Site administration | Django site admin')))
     self.browser.get('{}{}'.format(self.live_server_url, '/admin/logout/'))
     self.assertTrue(WebDriverWait(self.browser, 10).until(ec.title_is('Logged out | Django site admin')))
开发者ID:brendanoates,项目名称:employeeTimeRecorder,代码行数:13,代码来源:test_task_stories.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python expected_conditions.visibility_of函数代码示例发布时间:2022-05-27
下一篇:
Python expected_conditions.title_contains函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap