You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
substitute in all functions that used the print('[RPA][ERROR] - cannot find ' + element_identifier) function for rpa_error_cannot_find(element_identifier), example:
defclick(element_identifier=None, test_coordinate=None):
ifnot_started():
print('[RPA][ERROR] - use init() before using click()')
returnFalseifelement_identifierisNoneorelement_identifier=='':
print('[RPA][ERROR] - target missing for click()')
returnFalseiftest_coordinateisnotNoneandisinstance(test_coordinate, int):
element_identifier=coord(element_identifier, test_coordinate)
ifnotexist(element_identifier):
rpa_error_cannot_find(element_identifier)
returnFalseelifnotsend('click '+_sdq(element_identifier)):
returnFalseelse:
returnTrue
kensoh
changed the title
Add auto-screenshot of webpage or screen if element is missing
Error handling example, eg auto-screenshot of webpage or screen if element is missing [done]
Jul 4, 2021
kensoh
changed the title
Error handling example, eg auto-screenshot of webpage or screen if element is missing [done]
Error handling example, eg auto-screenshot of webpage if element is missing [done]
Jul 4, 2021
I can't merge to master because different users will have different ways to handle the error, to a different API endpoint for eg. However, if having this style of error handling is preferred by many users, then I could explore adding with a dummy function or let the function read from a predefined error-handler Python script.
Below are some possible iterations to the version that you are using. For eg, taking snapshot of webpage only or the entire screen when visual automation is used. Also, replacing spaces in the error input parameter may be a good practice to deal with spaces in the given identifier because filenames with spaces are not ideal on Linux / macOS.
hi Ken
as suggested here: aisingapore/TagUI#939
I also suggest creating this function in this repository.
suggestion to change tagui.py
substitute in all functions that used the
print('[RPA][ERROR] - cannot find ' + element_identifier)
function forrpa_error_cannot_find(element_identifier)
, example:example sample.py
results console:
result received at
https://webhook.site
thanks !
The text was updated successfully, but these errors were encountered: