[Erp5-report] r14887 - /erp5/trunk/utils/erp5mechanize/ERP5Mechanize.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jun 19 19:24:44 CEST 2007


Author: vincent
Date: Tue Jun 19 19:24:44 2007
New Revision: 14887

URL: http://svn.erp5.org?rev=14887&view=rev
Log:
Allow to submit a form using non-default button.
Add a method to "click" on listbox's action button.

Modified:
    erp5/trunk/utils/erp5mechanize/ERP5Mechanize.py

Modified: erp5/trunk/utils/erp5mechanize/ERP5Mechanize.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5mechanize/ERP5Mechanize.py?rev=14887&r1=14886&r2=14887&view=diff
==============================================================================
--- erp5/trunk/utils/erp5mechanize/ERP5Mechanize.py (original)
+++ erp5/trunk/utils/erp5mechanize/ERP5Mechanize.py Tue Jun 19 19:24:44 2007
@@ -113,13 +113,18 @@
     stop = time()
     return (start, stop)
 
-  def timeSubmit(self):
+  def timeSubmit(self, submit=None):
     """
       Returns begin and end timestamps.
     """
-    start = time()
-    self.last_page = self.browser.submit()
-    stop = time()
+    if submit is None:
+      start = time()
+      self.last_page = self.browser.submit()
+      stop = time()
+    else:
+      start = time()
+      self.last_page = self.browser.click(name=submit)
+      stop = time()
     return (start, stop)
 
   def doLogin(self, name, password):
@@ -439,6 +444,11 @@
     return self.timeOpen(str(self._getListbox().getElementsByTagName(u'tr')[line_number]\
                                                .getElementsByTagName(u'td')[column_number]\
                                                .getElementsByTagName(u'a')[0].attributes[u'href'].value))
+  def doListboxAction(self):
+    """
+      Validate listbox: this triggers the update of the selection with listbox search fields and checkboxes.
+    """
+    return self.timeSubmit(submit='Base_doSelect:method')
 
 class TimeResult:
   """




More information about the Erp5-report mailing list