Skip to content

Commit

Permalink
selenium: fix error_parsing index out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Dec 26, 2023
1 parent fc4cbca commit 68f1ac7
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions automon/integrations/seleniumWrapper/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,20 @@ def close(self):

@staticmethod
def error_parsing(error) -> tuple:
error_parsed = f'{error}'.splitlines()
error_parsed = [f'{x}'.strip() for x in error_parsed]
message = error_parsed[0]
session = error_parsed[1]
stacktrace = error_parsed[2:]
stacktrace = ' '.join(stacktrace)

return message, session, stacktrace
try:
error_parsed = f'{error}'.splitlines()
error_parsed = [f'{x}'.strip() for x in error_parsed]
message = error_parsed[0]
session = error_parsed[1]
stacktrace = error_parsed[2:]
stacktrace = ' '.join(stacktrace)

return message, session, stacktrace

except Exception as e:
logger.error(e)

return error, None, None

def find_element(
self,
Expand Down

0 comments on commit 68f1ac7

Please sign in to comment.