Browse Source

New method "WaitForElementPresent" for TestStepMaster

bernhardbuhl 3 years ago
parent
commit
27d1a6cbbc
1 changed files with 4 additions and 0 deletions
  1. 4 0
      baangt/TestSteps/TestStepMaster.py

+ 4 - 0
baangt/TestSteps/TestStepMaster.py

@@ -262,6 +262,9 @@ class TestStepMaster:
             logger.critical("GotoURL without URL called. Aborting. "
                             "Please provide URL either in Value or Locator columns")
 
+    def waitforelementpresent(self, **kwargs):
+        self.browserSession.findBy(xpath=kwargs["xpath"], css=kwargs["css"], id=kwargs["id"],
+                                   timeout=kwargs["lTimeout"], optional=kwargs["lOptional"])
 
     def settext(self, **kwargs):
             self.browserSession.findByAndSetText(xpath=kwargs["xpath"], css=kwargs["css"], id=kwargs["id"], value=kwargs["lValue"],
@@ -427,6 +430,7 @@ class TestStepMaster:
             logger.info(ex)
         if lLocator and not lLocatorType:  # If locatorType is empty, default it to XPATH
             lLocatorType = 'XPATH'
+
         xpath, css, id = self.__setLocator(lLocatorType, lLocator)
         return css, id, lActivity, lLocator, lLocatorType, xpath