??????????????????????????????
???????????? ???????[ 2012/9/6 14:35:22 ] ????????
??????????????????unittest?????????????Щ??????????????????????????testName????????????????case?????н?????????Щ????????????????????????????
def setTestName(self?? tname):
self.testname = tname
def getTestName(self):
return self.testname
def setCompleted(self):
self.completed = True
def isCompleted(self):
return self.completed
????????unittest??????? д?????
??????selenium????????????ЩС???????????? unittest ?????£??????????????????????????????????????????????? selenium ???????????????????????????????????????
def open(self??url):
self.sel.open(url)
def GetValue(self?? element):
value = self.sel.get_value(element)
self.assertLogTrue(True?? "Value for element %s is %s" %(element?? value))
return value
def isTextPresent(self?? text):
val = self.sel.is_text_present(text)
if val is False:
self.assertLogTrue(val?? note="error occured *************" + text +
" not found")
else:
print 'present (%s??%s)' % (text??val)
return val
def Select(self?? element?? selection):
if self.isElementPresent(element):
self.sel.select(element?? selection)
def Check(self?? element):
if self.isElementPresent(element):
self.sel.check(element)
def Type(self?? element?? text):
if self.isElementPresent(element):
self.sel.type(element?? text)
????????????????????????????????????????λ???????????????? xml ?С?
GWEB
link
//span[text()="Web"]
Web
GIMAGES
link
//span[text()="Images"]
Images
????name ???????????type ???????????locator ???????λ???expect_value ??????????
??????
???·???
??????????????????
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