??????????????????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 ??????????