I am writing an automation tool for a website. Therefore I am using Selenium in Java. For the real automation purpose I mainly use JavaScript through JavascriptExecutor. Most of the time everything works fine, but sometimes it crashes (e.g. 1 out of 10 times). I have the impression that then the code was just too fast. I am using implicit wait and explicit wait from the WebdriverWait class. I think this waits just wait for the dom or the elements within, but they are not waiting until all scripts are done. Therefore I need a function or snippet. As mentioned the website is using vue and angular.
Thanks in advance!