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

Python expected_conditions.visibility_of_element_located函数代码示例

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

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



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

示例1: click_batch_keyword_apply_link

 def click_batch_keyword_apply_link(self):
     """
     Clicks Batch Keyword Apply link.
     """
     self._wait.until(ec.visibility_of_element_located(self._batch_keyword_apply_link))
     click_element(self._driver, self._driver.find_element(*self._batch_keyword_apply_link))
     self._wait.until(ec.visibility_of_element_located(self._collection_modal))
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:BasketMarquee.py


示例2: test_TL_003_timeline_settings_add_new_tags

 def test_TL_003_timeline_settings_add_new_tags(self):
     """
     Test : test_FI_003 To verify that new tags added properly.
     Description : .
     Revision:
     Author : Bijesh
     :return: None
     """
     self.timelinepage.get_time_line_settings_link.click()
     WebDriverWait(self.driver, 20).until(EC.visibility_of_element_located((By.XPATH,
                                                              self.timelinepage._tl_settings_window_header_locator)))
     tag_count = 0
     try:
         if len(self.timelinepage.get_tl_settings_window_tags_delete_link)>=1:
             tag_count = len(self.timelinepage.get_tl_settings_window_tags_delete_link)
     except:
         pass
     self.timelinepage.get_tl_settings_window_start_date_textbox.clear()
     self.timelinepage.get_tl_settings_window_start_date_textbox.send_keys(self.timelinepage.time_line_start_date)
     self.timelinepage.get_tl_settings_window_end_date_textbox.clear()
     self.timelinepage.get_tl_settings_window_end_date_textbox.send_keys(self.timelinepage.time_line_end_date)
     self.timelinepage.get_tl_settings_window_tags_textbox.send_keys(self.timelinepage.time_line_tag_1)
     self.timelinepage.get_tl_settings_window_tags_add_button.click()
     self.timelinepage.get_tl_settings_window_save_button.click()
     sleep(2)
     self.timelinepage.get_time_line_settings_link.click()
     WebDriverWait(self.driver, 20).until(EC.visibility_of_element_located((By.XPATH,
                                                              self.timelinepage._tl_settings_window_header_locator)))
     tag_count_final = len(self.timelinepage.get_tl_settings_window_tags_delete_link)
     sleep(1)
     self.timelinepage.delete_all_tags()
     sleep(2)
     self.timelinepage.get_tl_settings_window_save_button.click()
     sleep(2)
     self.assertEqual(tag_count_final, tag_count+1,"New tag could not be added.")
开发者ID:IndecommGlobalServices,项目名称:Constellation,代码行数:35,代码来源:timelinetest.py


示例3: login

def login(driver):
    print('Logging in into %s ...' % EDIT_URL)
    driver.get(EDIT_URL)
    print('...')

    elem = WebDriverWait(driver, 30).until(
        EC.visibility_of_element_located((By.NAME, 'Email'))
    )
    elem.send_keys(LOGIN)
    try:
        # two-field login
        elem = driver.find_element_by_name('Passwd')
        elem.send_keys(PASS)
    except NoSuchElementException:
        # single-field login
        elem.send_keys(Keys.ENTER)
        elem = WebDriverWait(driver, 30).until(
            EC.visibility_of_element_located((By.NAME, 'Passwd'))
        )
        elem.send_keys(PASS)

    elem.send_keys(Keys.ENTER)
    print('Submitting ...')

    WebDriverWait(driver, 30).until(lambda x: x.title[-len(EDIT_TITLE):] == EDIT_TITLE)
    print('...')
开发者ID:SparKot,项目名称:foxtrick,代码行数:26,代码来源:cws_upload.py


示例4: setup_prevalence_chart

    def setup_prevalence_chart(self, disease_progression_name, points, timeout=None):
        """Sets up the prevalence chart for the given Disease Progression. Returns the name of the relational function
        that contains the prevalence chart."""
        if timeout is None:
            timeout = self.default_timeout

        self.click_navbar_element('Disease Progression')
        # Once the Disease Progression choices come up, click the desired one
        WebDriverWait(self.selenium, timeout=timeout).until(
            EC.visibility_of_element_located((By.LINK_TEXT, disease_progression_name))
        ).click()

        # Once the latent period, etc. options come up, click to bring up the prevalence chart
        prevalence_options = WebDriverWait(self.selenium, timeout=timeout).until(
            EC.visibility_of_element_located((By.ID, 'id_disease_prevalence'))
        )
        prevalence_name = Select(prevalence_options).first_selected_option.text # remember its name
        prevalence_options.click()

        # Once the prevalence chart comes up, overwrite the old points with the new ones.
        FunctionsPanel(
            WebDriverWait(self.selenium, timeout=timeout).until(
                EC.visibility_of_element_located((By.ID, 'functions_panel'))
            )
        ).set_points(points)

        return prevalence_name
开发者ID:NAVADMC,项目名称:ADSM,代码行数:27,代码来源:test_functional.py


示例5: test_TL_004_timeline_settings_add_new_tag_wrong_value

 def test_TL_004_timeline_settings_add_new_tag_wrong_value(self):
     """
     Test : test_FI_004 To verify that time line does not have any info if wrong tags has been added.
     Description : .
     Revision:
     Author : Bijesh
     :return: None
     """
     self.timelinepage.get_time_line_settings_link.click()
     WebDriverWait(self.driver, 20).until(EC.visibility_of_element_located((By.XPATH,
                                                              self.timelinepage._tl_settings_window_header_locator)))
     self.timelinepage.get_tl_settings_window_start_date_textbox.clear()
     self.timelinepage.get_tl_settings_window_start_date_textbox.send_keys(self.timelinepage.time_line_start_date)
     self.timelinepage.get_tl_settings_window_end_date_textbox.clear()
     self.timelinepage.get_tl_settings_window_end_date_textbox.send_keys(self.timelinepage.time_line_end_date)
     self.timelinepage.get_tl_settings_window_tags_textbox.send_keys(self.timelinepage.time_line_tag_2)
     self.timelinepage.get_tl_settings_window_tags_add_button.click()
     check_boxes_name = ["assessments","events","incidents", "field_interviews"]
     for item in check_boxes_name:
         self.timelinepage.check_box_enable(item)
     self.timelinepage.get_tl_settings_window_save_button.click()
     sleep(2)
     time_line_info = len(self.timelinepage.get_time_line_all_images)
     self.timelinepage.get_time_line_settings_link.click()
     WebDriverWait(self.driver, 20).until(EC.visibility_of_element_located((By.XPATH,
                                                              self.timelinepage._tl_settings_window_header_locator)))
     self.timelinepage.delete_all_tags()
     sleep(2)
     self.timelinepage.get_tl_settings_window_save_button.click()
     sleep(2)
     self.assertEqual(time_line_info, 1, "Tag could not be added properly.")
开发者ID:IndecommGlobalServices,项目名称:Constellation,代码行数:31,代码来源:timelinetest.py


示例6: click_rectangle_button

 def click_rectangle_button(self):
     """
     Clicks rectangle button.
     """
     if not is_element_present(self._driver, *self._rectangle_selected_button):
         self._wait.until(ec.visibility_of_element_located(self._rectangle_button)).click()
         self._wait.until(ec.visibility_of_element_located(self._rectangle_selected_button))
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:FileContentModalExhibit.py


示例7: wait_to_appear

    def wait_to_appear(self, item):
        """Wait for item to appear

           * If there are no spaces in item, waits for element with HTML id "item" to appear.
           * "first class1" - waits for first item with  HTML class "class1" to appear.
           * "2nd class1 class2" - waits for the 2nd item with HTML classes class1 and class2 to appear.
           * "last class1 class2" - waits for the last element with classes class1 and class2 to appear.
        """
        item = HitchSeleniumItem(item)
        if item.is_id:
            WebDriverWait(self.driver, self.wait_for_timeout).until(
                EC.visibility_of_element_located((By.ID, item.html_id))
            )
        else:
            full_xpath = """//*[{}][{}]""".format(
                " and ".join([
                    """contains(concat(' ', normalize-space(@class), ' '), ' {} ')""".format(
                        class_name
                    ) for class_name in item.html_classes]
                ),
                str(item.index + 1) if item.index >= 0 else "last()"
            )

            WebDriverWait(self.driver, self.wait_for_timeout).until(
                EC.visibility_of_element_located((By.XPATH, full_xpath))
            )
开发者ID:hitchtest,项目名称:hitchselenium,代码行数:26,代码来源:step_library.py


示例8: test_shows_patient_data

    def test_shows_patient_data(self):
        """
        Test that a patient record shows data (graph/table) for the patient
        """
        patients = self.patient_list_page.get_list_items()

        PatientPage(self.driver).select_patient(patients)

        ui.WebDriverWait(self.driver, 1).until(
            ec.visibility_of_element_located(patient_page_locators.GRAPH_CHART)
        )

        patient_graph = self.driver.find_element(*
                                                 patient_page_locators
                                                 .GRAPH_CHART)

        self.assertEqual(patient_graph.is_displayed(), True, 'Graph not found')

        self.driver.find_element(*patient_page_locators
                                 .TABLE_TAB_BUTTON).click()

        ui.WebDriverWait(self.driver, 1).until(
            ec.visibility_of_element_located
            (patient_page_locators.TABLE_CONTAINER_TABLE))

        patient_table = self.driver.find_element(*
                                                 patient_page_locators
                                                 .TABLE_CONTAINER_TABLE)
        self.assertEqual(patient_table.is_displayed(), True, 'Table not found')
开发者ID:Gimpneek,项目名称:openeobs-quality-assurance,代码行数:29,代码来源:test_patient_list_page.py


示例9: submit_empty_form

def submit_empty_form(expected_data):
    def _assert_has_no_errors():
        assert expected_data == output_data

    Arsenic().find_element_by_xpath('//button[@class="btn btn-success form-submit"]').click()
    try:
        WebDriverWait(Arsenic(), 10).until(
            EC.visibility_of_element_located((By.ID, 'state-given_names'))
        )
        WebDriverWait(Arsenic(), 10).until(
            EC.visibility_of_element_located((By.ID, 'state-display_name'))
        )
        WebDriverWait(Arsenic(), 10).until(
            EC.visibility_of_element_located((By.ID, 'state-research_field'))
        )
        output_data = {
            'given-name': Arsenic().find_element_by_id(
                'state-given_names'
            ).text,
            'display-name': Arsenic().find_element_by_id(
                'state-display_name'
            ).text,
            'reserach-field': Arsenic().find_element_by_id(
                'state-research_field'
            ).text
        }
    except (ElementNotVisibleException, WebDriverException):
        output_data = {}

    return ArsenicResponse(assert_has_no_errors_func=_assert_has_no_errors)
开发者ID:david-caro,项目名称:inspire-next,代码行数:30,代码来源:author_submission_form.py


示例10: add_students_bulk

def add_students_bulk(driver, users):
    '''Add students to a recently created contest.'''

    driver.wait.until(
        EC.element_to_be_clickable(
            (By.CSS_SELECTOR,
             ('li.contestants > a')))).click()
    driver.wait.until(
        EC.visibility_of_element_located(
            (By.CSS_SELECTOR, 'div.contestants')))

    driver.wait.until(
        EC.visibility_of_element_located(
            (By.XPATH, (
                '//textarea[contains(@class, "contestants")]')))).send_keys(
                    ', '.join(users))
    driver.wait.until(
        EC.element_to_be_clickable(
            (By.CLASS_NAME, ('user-add-bulk')))).click()
    for user in users:
        driver.wait.until(
            EC.visibility_of_element_located(
                (By.XPATH,
                 '//table[contains(@class, "participants")]//a[text()="%s"]'
                 % user)))
开发者ID:lhchavez,项目名称:omegaup,代码行数:25,代码来源:test_contest.py


示例11: _do_signup

    def _do_signup(self):
        # Go to the webpage
        self.browser.get(self.url)
        wait = ui.WebDriverWait(self.browser, self.timeout)
        wait.until(expected_conditions.visibility_of_element_located(["id", "logo"]))

        # Log out any existing user
        if self.browser.find_elements_by_id("nav_logout"):
            nav = self.browser.find_element_by_id("nav_logout")
            if nav.is_displayed():
                self.browser.find_element_by_id("nav_logout").click()
                wait = ui.WebDriverWait(self.browser, self.timeout)
                wait.until(expected_conditions.title_contains(("Home")))

        # Go to the sign-up page
        wait = ui.WebDriverWait(self.browser, self.timeout)
        wait.until(expected_conditions.visibility_of_element_located(["id", "nav_signup"]))
        self.browser.find_element_by_id("nav_signup").click()
        wait = ui.WebDriverWait(self.browser, self.timeout)
        wait.until(expected_conditions.title_contains(("Sign up")))

        # Sign up (don't choose facility or group)
        wait = ui.WebDriverWait(self.browser, self.timeout)
        wait.until(expected_conditions.visibility_of_element_located(["id", "id_username"]))
        self.browser.find_element_by_id("id_username").send_keys(self.username)
        wait = ui.WebDriverWait(self.browser, self.timeout)
        wait.until(expected_conditions.visibility_of_element_located(["id", "id_password_first"]))
        self.browser.find_element_by_id("id_password_first").send_keys(self.password)
        self.browser.find_element_by_id("id_password_recheck").send_keys(self.password)
        self.browser.find_element_by_id("id_password_recheck").send_keys(Keys.TAB + Keys.RETURN)
        wait = ui.WebDriverWait(self.browser, self.timeout)
        wait.until(expected_conditions.visibility_of_element_located(["id", "logo"]))
开发者ID:Aypak,项目名称:ka-lite,代码行数:32,代码来源:base.py


示例12: test_missing_exchange

def test_missing_exchange(exchange, browser, port, class_files, tempdir):
    # remove the exchange directory and fetched assignments
    rmtree(exchange)
    rmtree(os.path.join(tempdir, "Problem Set 1"))

    _load_assignments_list(browser, port)
    _wait_until_loaded(browser)

    # make sure all the errors are showing
    _wait(browser).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "#released_assignments_list_error")))
    _wait(browser).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "#fetched_assignments_list_error")))
    _wait(browser).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "#submitted_assignments_list_error")))

    # verify that the dropdown list shows an error too
    default = browser.find_element_by_css_selector("#course_list_default")
    assert default.text == "Error fetching courses!"

    # recreate the exchange and make sure refreshing works as expected
    os.makedirs(exchange)

    # release an assignment
    run_nbgrader(["assign", "Problem Set 1", "--force"])
    run_nbgrader(["release", "Problem Set 1", "--course", "abc101", "--force"])

    # click the refresh button
    browser.find_element_by_css_selector("#refresh_assignments_list").click()
    _wait_until_loaded(browser)

    # wait for the released assignments to update
    rows = _wait_for_list(browser, "released", 1)
    assert rows[0].find_element_by_class_name("item_name").text == "Problem Set 1"
    assert rows[0].find_element_by_class_name("item_course").text == "abc101"
开发者ID:jhamrick,项目名称:nbgrader,代码行数:32,代码来源:test_assignment_list.py


示例13: click_batch_image_order_link

 def click_batch_image_order_link(self):
     """
     Clicks Batch Image Order link.
     """
     self._wait.until(ec.visibility_of_element_located(self._batch_image_order_link))
     click_element(self._driver, self._driver.find_element(*self._batch_image_order_link))
     self._wait.until(ec.visibility_of_element_located(self._collection_modal))
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:BasketMarquee.py


示例14: click_download_archive_of_fpos_link

 def click_download_archive_of_fpos_link(self):
     """
     Clicks Download Archive of FPOs link.
     """
     self._wait.until(ec.visibility_of_element_located(self._download_archive_of_fpos_link))
     click_element(self._driver, self._driver.find_element(*self._download_archive_of_fpos_link))
     self._wait.until(ec.visibility_of_element_located(self._collection_modal))
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:BasketMarquee.py


示例15: CreatePage

def CreatePage(driver, stackURL, cell):
    
    pageName = excelSheet[cell].value
    typePage = DeterminePage(driver, cell)  
    
    testID = "ctl00_ContentPlaceHolder1_ctl00_ctl00_menu_m2"
    #testID = GetID(driver, "ctl00_ContentPlaceHolder1_ctl00_ctl00_menu_m2", True)
    
    WebDriverWait(driver, 10).until(ec.visibility_of_element_located((By.ID, testID)))
    driver.find_element_by_id(testID).click()
    
    if(typePage == "Content"): num = "6"
    else: num = "7"
    
    testID = "ctl00_ContentPlaceHolder1_ctl00_ctl00_menu_m2_m" + num
    #testID = GetID(driver,"ctl00_ContentPlaceHolder1_ctl00_ctl00_menu_m2_m" + num, True)
    
    WebDriverWait(driver, 10).until(ec.visibility_of_element_located((By.ID, testID)))
    driver.find_element_by_id(testID).click()
    
    WebDriverWait(driver, 10).until(ec.visibility_of_element_located((By.ID, GetID(driver, "ctl00_ContentPlaceHolder1_ctl00_txtTitle", False))))    
    input = driver.find_element_by_id(GetID(driver, "ctl00_ContentPlaceHolder1_ctl00_txtTitle", False))
    input.send_keys(pageName)
    
    print(typePage)
    if(typePage == "Content"):
        CreateContentPage(driver, stackURL, cell)
    elif(typePage == "External"):
        CreateLinkPage(driver, stackURL, cell)
    elif(typePage == "File"):
        CreateFilePage(driver, stackURL, cell)
开发者ID:HowardWei,项目名称:Content-Migration,代码行数:31,代码来源:CreateSkeleton.py


示例16: _load_assignments_list

def _load_assignments_list(browser, port, retries=5):
    # go to the correct page
    browser.get("http://localhost:{}/tree".format(port))

    def page_loaded(browser):
        return browser.execute_script(
            'return typeof IPython !== "undefined" && IPython.page !== undefined;')

    # wait for the page to load
    try:
        _wait(browser).until(page_loaded)
    except TimeoutException:
        if retries > 0:
            print("Retrying page load...")
            # page timeout, but sometimes this happens, so try refreshing?
            _load_assignments_list(browser, port, retries=retries - 1)
        else:
            print("Failed to load the page too many times")
            raise

    # wait for the extension to load
    _wait(browser).until(EC.presence_of_element_located((By.CSS_SELECTOR, "#assignments")))

    # switch to the assignments list
    element = browser.find_element_by_link_text("Assignments")
    element.click()

    # make sure released, downloaded, and submitted assignments are visible
    _wait(browser).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "#released_assignments_list")))
    _wait(browser).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "#fetched_assignments_list")))
    _wait(browser).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "#submitted_assignments_list")))
开发者ID:0905huhy,项目名称:nbgrader,代码行数:31,代码来源:test_assignment_list.py


示例17: click_metadata_tab

 def click_metadata_tab(self):
     """
     Clicks the metadata tab
     """
     self._wait.until(ec.visibility_of_element_located(self._metadata_active_tab))
     self._driver.find_element(*self._metadata_tab).click()
     self._wait.until(ec.visibility_of_element_located(self._wnv_text_panel))
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:FileContentModalExhibit.py


示例18: click_batch_report_link

 def click_batch_report_link(self):
     """
     Clicks Batch report link.
     """
     self._wait.until(ec.visibility_of_element_located(self._batch_report_link))
     click_element(self._driver, self._driver.find_element(*self._batch_report_link))
     self._wait.until(ec.visibility_of_element_located(self._generate_batch_report_button))
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:BasketExhibit.py


示例19: testExpectedConditionVisibilityOfElementLocated

 def testExpectedConditionVisibilityOfElementLocated(self, driver, pages):
     pages.load("javascriptPage.html")
     with pytest.raises(TimeoutException):
         WebDriverWait(driver, 0.7).until(EC.visibility_of_element_located((By.ID, 'clickToHide')))
     driver.find_element_by_id('clickToShow').click()
     element = WebDriverWait(driver, 5).until(EC.visibility_of_element_located((By.ID, 'clickToHide')))
     assert element.is_displayed() is True
开发者ID:zhjwpku,项目名称:selenium,代码行数:7,代码来源:webdriverwait_tests.py


示例20: test_clicking_nav_menu_brings_confirmation_when_dirty

 def test_clicking_nav_menu_brings_confirmation_when_dirty(self):
     """
     When the admin canvas is "dirty" (the user has made unsaved changes), 
     clicking on the left-hand menu will bring up a confirmation box asking
     if the user really wants to discard her changes.
     """
     self.admin_login_and_open_existing_class_edit()
     self.open_topic_tree_one_level_with_activities()
     
     self.admin_updates_map()
     
     topic_link = self.browser.find_element_by_xpath(
             '//ul[@class="nav nav-tabs nav-stacked main-menu"]/li[2]/a[@class="view-tree"]')
     topic_link.click()
     
     modal_wait = WebDriverWait(self.browser, 3).until(
             EC.visibility_of_element_located((By.CLASS_NAME,'bootbox')))
     modal_wait = WebDriverWait(self.browser, 3).until(
             EC.visibility_of_element_located((By.CLASS_NAME,'modal-backdrop')))
     
     modal_body = self.browser.find_element_by_class_name('modal-body')
     self.assertEqual(
         'Really throw away all of your un-saved work?',
         modal_body.text)
     
     self.check_for_links('No!')
     self.check_for_links('Yes')
开发者ID:cjshawMIT,项目名称:mc3_aloha,代码行数:27,代码来源:admin_vcb_edit_class_local.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python select.Select类代码示例发布时间:2022-05-27
下一篇:
Python expected_conditions.visibility_of函数代码示例发布时间: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