??????????????????????????????
???????????? ???????[ 2012/9/6 14:35:22 ] ????????
??????? xml ?????????δ?????????????????????????? python ?? xml ?????????????????????д????????????????????? xml ??????????
from xml.dom import minidom
class PageData():
def __init__(self?? page_name?? file):
self.name = page_name
self.data = minidom.parse(file)
self.xpth_dict = self.XML_Dict()
def XML_Dict(self):
xpath_dict = {}
for i in self.data.getElementsByTagName(self.name):
xpath_dict[str(i.childNodes[1].firstChild.nodeValue)] =
[str(i.childNodes[5].firstChild.nodeValue)??
str(i.childNodes[7].firstChild.nodeValue)]
return xpath_dict
def GetLocator(self?? object_name):
return self.xpth_dict[object_name][0]
def GetValue(self?? object_name):
return self.xpth_dict[object_name][1]
???????????????棬????????????????????????????????????????
def testAutoCompleteFunctionMouseMove(self):
'''test the function of auto complete. case 2: when user move mouse to the suggestion?? there will be a link '''
self.initTest("testAutoCompleteFunctionMouseMove")
self.open('http://www.google.com/ncr')
GoogleHomePage = data_parser.PageData("GoogleHomePage"?? self.data_file)
self.Type(GoogleHomePage.GetLocator('SEARCHTEXT')?? 's')
GoogleAutoComplete = data_parser.PageData("AutoCompleteCase"?? self.data_file)
self.isElementPresent(GoogleAutoComplete.GetLocator("SUGGESTIONFIELD"))
time.sleep(10)
self.MouseMove(GoogleAutoComplete.GetLocator("SUGGESTIONONEFORS"))
expect_text = "I'm Feeling Lucky ?"
self.assertLogTrue(self.isTextPresent(expect_text)?? "The text %s has been displayed" %expect_text)
self.MouseMove(GoogleAutoComplete.GetLocator("SUGGESTIONTWOFORS"))
time.sleep(10)
self.assertLogTrue(self.isTextPresent(expect_text)?? "The text %s has been displayed" %expect_text)
self.endTest()
?????????????????????????????????????????????????????????????????????????????Щ?1????????????????????????????????????????????????????
???????
???????????????????????????κε???????飬???????????????е?С??????????????????????????????? ?????????и???? test frame ????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11