a = self.w.switch_to_active_element()
a.send_keys(message+'\n')
- def find_field(self, field):
- self.logger.info('finding %s field' % field)
+ def find_field(self, field_regexp, name=None):
+ self.logger.info('finding %s field' % field_regexp)
# found id start by manually focusing in the element and running
# >>> a = s.w.switch_to_active_element()
# >>> a.get_attribute('id')
match = False
for f in fields:
granddad = f.find_element_by_xpath('/../..')
- if granddad.get_text().startswith(field):
+ if field_regexp.match(granddad.get_text()) != None:
match = True
break
if match != True:
- raise KeyError(field)
+ raise KeyError(name)
return (granddad, f)