Look for actual <button>s as well
This commit is contained in:
+1
-1
@@ -215,7 +215,7 @@ SeleniumWrapper
|
||||
>>> br.img(alt="I am sorry", ext="sorry.gif")
|
||||
|
||||
* button(value, eager=False, timeout=3)
|
||||
find_element_by_xpath("//input[@type='submit' or @type='button' and @value='{}']".format(value), timeout)::
|
||||
find_element_by_xpath("//input[@type='submit' or @type='button' and @value='{0}']|.//button[text()='{0}']".format(value), timeout)::
|
||||
|
||||
>>> br.button("Send this form").click()
|
||||
|
||||
|
||||
@@ -440,7 +440,9 @@ class SeleniumWrapper(object):
|
||||
return self.xpath(xpath, eager, timeout)
|
||||
|
||||
def button(self, value, eager=False, timeout=None):
|
||||
return self.xpath(".//input[@type='submit' or @type='button' and @value='{0}']".format(value), eager, timeout)
|
||||
return self.xpath(
|
||||
".//input[@type='submit' or @type='button' and @value='{0}']"
|
||||
"|.//button[text()='{0}']".format(value), eager, timeout)
|
||||
|
||||
def checkbox(self, eager=False, timeout=None, **attributes):
|
||||
attributes["type"] = "checkbox"
|
||||
|
||||
Reference in New Issue
Block a user