本文整理汇总了Python中helpers.WebdriverUtilities.WebdriverUtilities.pressEnterKey方法的典型用法代码示例。如果您正苦于以下问题:Python WebdriverUtilities.pressEnterKey方法的具体用法?Python WebdriverUtilities.pressEnterKey怎么用?Python WebdriverUtilities.pressEnterKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers.WebdriverUtilities.WebdriverUtilities
的用法示例。
在下文中一共展示了WebdriverUtilities.pressEnterKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testDeleteObjects
# 需要导入模块: from helpers.WebdriverUtilities import WebdriverUtilities [as 别名]
# 或者: from helpers.WebdriverUtilities.WebdriverUtilities import pressEnterKey [as 别名]
def testDeleteObjects(self):
self.testname="TestDeleteObjects"
self.setup()
util = WebdriverUtilities()
util.setDriver(self.driver)
element = Elements()
grcobject = GRCObject()
do = Helpers(self)
do.setUtils(util)
do.login()
for section in ["Regulation",
"Objective",
"Program",
"Contract",
"Policy",
"Control",
"System",
"Process",
"Data",
"Product",
"Project",
"Facility",
"Market",
"Group"
]:
print "Starting Deletion of Objects for " + section
deleted_objects=0
do.ensureLHNSectionExpanded(section)
do.checkMyWorkBox()
object_left_nav_section_object_link = element.left_nav_expand_object_section_link.replace("OBJECT", section)
# enter term to search
util.inputTextIntoField("Auto", element.left_nav_search_input_textfield)
util.pressEnterKey(element.left_nav_search_input_textfield)
left_nav_first_link = element.left_nav_first_object_link_in_the_section.replace("SECTION",section)
util.waitForElementToBePresent(left_nav_first_link)
lef_nav_objects_for_deletion_in_section = element.left_nav_objects_candidate_for_deletion.replace("SECTION",section )
number_of_auto_objects = do.countOfAnyObjectLHS(section)
deleted_objects = number_of_auto_objects - 2 # leave 2 behind
while (deleted_objects > 0):
do.navigateToObjectAndOpenObjectEditWindow(section,lef_nav_objects_for_deletion_in_section, refresh_page=False)
do.deleteObject()
deleted_objects = deleted_objects - 1 #LHN collapse after this
do.showLHMenu(True) # reopen it
object_left_nav_section_object_link = element.left_nav_expand_object_section_link.replace("OBJECT", section)
left_nav_first_link = element.left_nav_first_object_link_in_the_section.replace("SECTION",section)
util.waitForElementToBePresent(left_nav_first_link)
lef_nav_objects_for_deletion_in_section = element.left_nav_objects_candidate_for_deletion.replace("SECTION",section )
print "Finished deletion of objects for " + section + ". " + str(deleted_objects) + " object is left to be deleted."