Resolved problem with NoSuchElementException and TimeOutException by adding sleep() before every action (adding it in on the beginning do_while_show() def wasn't help ).
Also done a little bit of refactoring