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
peterrexj edited this page Sep 10, 2019
·
1 revision
Tips and Tricks in automation (Selenium Essentials)
Declaring controls
Use expression while declaring controls.
For example, with the below line using (=>), whenever you access the control, every time it tries to retry and find element without storing into a field. This will help to avoid the StaleException and always make sure the element is available in the page.
Use WaitAndClick(int timeToWaitInSeconds), when you have elements visible but due to some animation on the responsive page, fails to make the click operation. Use wait and click and pass 1 or 2 seconds for wait, to complete the animation and proceed with the click operation.