Allow to silently skip no found elements
This commit is contained in:
parent
5af78df079
commit
5cd4965d2a
|
@ -3735,15 +3735,18 @@ class Window:
|
||||||
FillFormWithValues(self, values_dict)
|
FillFormWithValues(self, values_dict)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def FindElement(self, key):
|
def FindElement(self, key, silent_on_error=None):
|
||||||
element = _FindElementFromKeyInSubForm(self, key)
|
element = _FindElementFromKeyInSubForm(self, key)
|
||||||
if element is None:
|
if element is None:
|
||||||
print('*** WARNING = FindElement did not find the key. Please check your key\'s spelling ***')
|
if not silent_on_error == True:
|
||||||
PopupError('Keyword error in FindElement Call',
|
print('*** WARNING = FindElement did not find the key. Please check your key\'s spelling ***')
|
||||||
'Bad key = {}'.format(key),
|
PopupError('Keyword error in FindElement Call',
|
||||||
'Your bad line of code may resemble this:',
|
'Bad key = {}'.format(key),
|
||||||
'window.FindElement("{}")'.format(key))
|
'Your bad line of code may resemble this:',
|
||||||
return ErrorElement(key=key)
|
'window.FindElement("{}")'.format(key))
|
||||||
|
return ErrorElement(key=key)
|
||||||
|
else:
|
||||||
|
return False
|
||||||
return element
|
return element
|
||||||
|
|
||||||
Element = FindElement # Shortcut function
|
Element = FindElement # Shortcut function
|
||||||
|
|
Loading…
Reference in New Issue