本文整理汇总了Python中resources.methods.UIMethods.is_element_present函数的典型用法代码示例。如果您正苦于以下问题:Python is_element_present函数的具体用法?Python is_element_present怎么用?Python is_element_present使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_element_present函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: is_file_displayed_in_folder_content
def is_file_displayed_in_folder_content(self, file_name):
"""
Verifies if a file is displayed in folder content.
"""
video_alt = (By.XPATH, "//img[@alt='" + file_name + "']")
file_link = (By.XPATH, "//a[@data-modaltitle='" + file_name + "']")
return is_element_present(self._driver, *video_alt) or is_element_present(self._driver, *file_link)
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:FolderContentBase.py
示例2: click_view_video_file
def click_view_video_file(self, video_name):
"""
Clicks the Video file.
:param video_name: The file name.
"""
video_alt = (By.XPATH, "//img[contains(@alt,'" + video_name + "')]")
file_link = (By.XPATH, "//a[contains(@data-modaltitle,'" + video_name + "')]")
file_locator = []
if is_element_present(self._driver, *video_alt):
file_locator = video_alt
elif is_element_present(self._driver, *file_link):
file_locator = file_link
self._wait.until(ec.visibility_of_element_located(file_locator))
click_element(self._driver, self._driver.find_element(*file_locator))
self._wait.until(ec.visibility_of_element_located(self._play_button))
开发者ID:mmguzman,项目名称:Xinet,代码行数:15,代码来源:FolderContentMarquee.py
示例3: verify_if_data_fields_summary_link_is_displayed
def verify_if_data_fields_summary_link_is_displayed(self):
"""
Verifies if the 'Summary link' is displayed
"""
if not (is_element_present(self._driver, *self._summary_selected)):
self._driver.find_element(*self._summary_link).click()
self._wait.until(ec.visibility_of_element_located(self._summary_selected))
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:WebNativeDatabase.py
示例4: is_db_backup_displayed
def is_db_backup_displayed(self, server_name):
"""
Returns true if a DB Backup is displayed.
"""
db_backup_dir = self.get_db_backup_path(server_name)
db_backup_value = (By.XPATH, "//span[contains(text(),'" + db_backup_dir + "')]")
return is_element_present(self._driver, *db_backup_value)
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:WebNativeDatabase.py
示例5: is_permission_set_displayed
def is_permission_set_displayed(self, permission_set_name):
"""
Verifies if a Permission Set is displayed in Permission Sets section.
"""
self._wait.until(ec.visibility_of_element_located(self._templates_text))
permission_set_value = (By.XPATH, "//a[text()='" + permission_set_name + "']")
return is_element_present(self._driver, *permission_set_value)
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:WebNativeDatabase.py
示例6: click_navigator_link
def click_navigator_link(self):
"""
Clicks the navigator link.
"""
if is_element_present(self._driver, *self._navigator_link):
self._driver.find_element(*self._navigator_link).click()
self._wait.until(ec.visibility_of_element_located(self._navigator_table))
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:SidePaneNavigatorExhibit.py
示例7: select_volume
def select_volume(self, folder_name):
"""
Clicks the browse folder name given in ``folder_name`` argument.
:param folder_name: volume name to select.
"""
if is_element_present(self._driver, By.XPATH, "//a[contains(@title,'" + folder_name + "')]"):
return SidePaneNavigatorExhibit()
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:HomeExhibit.py
示例8: close_apply_keyword_modal
def close_apply_keyword_modal(self):
"""
Clicks the 'x' button to close the keyword modal.
"""
if is_element_present(self._driver, *self._close_apply_keywords_button):
click_element(self._driver, self._driver.find_element(*self._close_apply_keywords_button))
self._wait.until(ec.invisibility_of_element_located(self._collection_modal))
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:BasketMarquee.py
示例9: is_selected_page_displayed_in_folder_content
def is_selected_page_displayed_in_folder_content(self, expected_result):
"""
Verifies if selected page is displayed in folder content.
:param expected_result: The page to be displayed.
"""
selected_page = (By.XPATH, "//div[@class='detailsheading' and contains(.,'Page " + expected_result[0] + " selected')]")
return is_element_present(self._driver, *selected_page)
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:FileContentModalExhibit.py
示例10: click_view_file
def click_view_file(self, file_name):
"""
Clicks the select file to display the "view file", e.g. rd_Old_Tom_and_Jerry_Open.mpg, 2MonthsAgo.indd
:param file_name: The file name.
"""
video_alt = (By.XPATH, "//img[contains(@alt,'" + file_name + "')]")
file_link = (By.XPATH, "//a[contains(@data-modaltitle,'" + file_name + "')]")
file_locator = []
_file_name_image = (By.XPATH, "//div[contains(@id,'details-file')]//img[@alt='" + file_name + "']")
if is_element_present(self._driver, *video_alt):
file_locator = video_alt
elif is_element_present(self._driver, *file_link):
file_locator = file_link
self._wait.until(ec.visibility_of_element_located(file_locator))
click_element(self._driver, self._driver.find_element(*file_locator))
self._wait.until(ec.visibility_of_element_located(_file_name_image))
开发者ID:mmguzman,项目名称:Xinet,代码行数:16,代码来源:FolderContentMarquee.py
示例11: click_recent_activity_in_history_list
def click_recent_activity_in_history_list(self):
"""
Clicks recent activity in history list
"""
if is_element_present(self._driver, *self._history_item_collapsed):
self._wait.until(ec.element_to_be_clickable(self._history_item_collapsed)).click()
self._wait.until(ec.visibility_of_element_located(self._activity_item_collapsed))
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:FileContentModalExhibit.py
示例12: is_folder_revealed_under_parent_folder
def is_folder_revealed_under_parent_folder(self, folder_name):
"""
Returns True if the folder given in ``folder_name`` argument is revealed below the parent folder
in the side pane, otherwise False.
"""
folder_name_selector = (By.XPATH, self.is_folder_revealed_locator_template % folder_name)
return is_element_present(self._driver, *folder_name_selector)
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:SidePaneNavigatorBase.py
示例13: 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
示例14: is_error_displayed_login_page
def is_error_displayed_login_page(self):
"""
Verifies if an error is displayed in Login page.
:return: Returns True if the error is displayed.
"""
error_message_selector = (By.XPATH, self.error_message_template)
return is_element_present(self._driver, *error_message_selector)
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:LoginPageBase.py
示例15: is_folder_link_selected
def is_folder_link_selected(self, folder_name):
"""
Returns True if the folder name given in ``folder_name`` argument is selected in the side pane,
otherwise False.
"""
folder_name_selector = (By.XPATH, "//li[@id='navigator_selected']/a[@class='filename' and contains(@title,'" + folder_name + "')]")
return is_element_present(self._driver, *folder_name_selector)
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:SidePaneNavigatorBase.py
示例16: is_selected_page_loaded_in_file_content_modal
def is_selected_page_loaded_in_file_content_modal(self, page_number):
"""
Verifies if selected page is loaded in file content modal.
:param page_number: The number of page selected.
"""
preview_file = (By.XPATH, "//div[@id='spreadcell" + page_number + "' and contains(@class,'previewhighlight')]")
return is_element_present(self._driver, *preview_file)
开发者ID:mmguzman,项目名称:Xinet,代码行数:7,代码来源:FileContentModalExhibit.py
示例17: is_comment_displayed_in_annotation_list
def is_comment_displayed_in_annotation_list(self, expected_result):
"""
Verifies if comment is displayed in annotation list
:param expected_result: The comment to verify.
:return: True if displayed, otherwise False.
"""
new_annotation = (By.XPATH, "//li[contains(@id,'annotationlist_new')]/descendant::div[contains(@class,'item') and contains(.,'" + expected_result + "')]")
return is_element_present(self._driver, *new_annotation)
开发者ID:mmguzman,项目名称:Xinet,代码行数:8,代码来源:FileContentModalExhibit.py
示例18: is_annotation_displayed_in_file_content_modal
def is_annotation_displayed_in_file_content_modal(self, annotation_type):
"""
Verifies if annotation type is displayed in file content modal.
:param annotation_type: The annotation type.
:return: True if displayed, otherwise False.
"""
_annotation_button = (By.XPATH, "//span[.='"+annotation_type+"']")
return is_element_present(self._driver, *_annotation_button)
开发者ID:mmguzman,项目名称:Xinet,代码行数:8,代码来源:FileContentModalExhibit.py
示例19: is_annotation_item_displayed_in_annotation_list
def is_annotation_item_displayed_in_annotation_list(self, expected_result):
"""
Verifies if annotation item is displayed in Annotation list
:param expected_result: The expected result regarding annotation (Flag, Stamp, Comment,etc)
:return: True if displayed, otherwise False.
"""
flag_in_annotation = (By.XPATH, "//ul[@id='annotationList']/descendant::div[.='" + expected_result[1] + "']")
return is_element_present(self._driver, *flag_in_annotation)
开发者ID:mmguzman,项目名称:Xinet,代码行数:8,代码来源:FileContentModalExhibit.py
示例20: is_selected_version_displayed_in_file_content_modal
def is_selected_version_displayed_in_file_content_modal(self, version_name):
"""
Verifies if selected version is displayed in file content modal.
:param version_name: The version name.
:return: True if displayed, otherwise False.
"""
_expected_version = (By.XPATH, "//div[@id='annotationCanvas']/img[contains(@src,'" + version_name + "')]")
return is_element_present(self._driver, *_expected_version)
开发者ID:mmguzman,项目名称:Xinet,代码行数:8,代码来源:FileContentModalExhibit.py
注:本文中的resources.methods.UIMethods.is_element_present函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论