My mobile app is moved to background and it is reset i.e when I pause execution and put the app in focus it shows login page and not the page where it was executing certain behaviour.
Also this happens very randomly, and no error is printed in logs as well. I am trying to scroll in app and then suddenly the app is sent to background.
Below is the code snippet for scrolling where element is the xpath of element:
if direction == 'up':
self.builtIn.run_keyword("Swipe By Percent", 50, 80, 50, 50, 400)
element_found = self.builtIn.run_keyword_and_return_status(
"Element Should Be Visible", element)
self.builtIn.run_keyword_and_return_status("Log", element_found)
elif direction == 'down':
self.builtIn.run_keyword("Swipe By Percent", 50, 50, 50, 80, 400)
element_found = self.builtIn.run_keyword_and_return_status(
"Element Should Be Visible", element)
self.builtIn.run_keyword_and_return_status("Log", element_found)