Selenium WebDriver Tips for Beginners – User friendly Tech help

We are helping our community to learn selenium, in this endeavour we are sharing some root tips. Please feel free to add more to the list from your experience.
n
nIt is rightly said, “All the so-called ‘secrets of success’ will not work unless you do.” So build your learning and share more.

n

n

n

n

n

n

n

n

Go step by step to learn selenium, it requires co-ordinated self effort to finish the task.

n

1. Always try to locators in the preference order, id > css > name > xpath
n

n

2. Say no to Thread.sleep (), implement the implicit or explicit wait methodologies in selenium or try to write your own conditional logic to handle the elements, rather than using Thread. Sleep.
n

n

3. Using switch case, to implement various drivers of multiple browsers
n

n

4. Clean the things, after the execution is completed. It can be achieved by using– Close (), Quit (), and Dispose ().
n

n

5. Assert vs verify, be clear what we need to use.

n

If we use an assert, the test will stop at that point and not run any subsequent checks. In contrast, verify commands will not terminate the test. It will run to completion whether the checks find defects or not. Thus check your requirement and choose the one which is more suitable.Generally Assert is more commonly used than verify due to their immediate feedback.
n

n

6. Disable updates, once we have the right version of browser (say Firefox) and WebDriver jars, make sure that you disable the automatic update of browser.
n

n

7. Utilize the inbuilt tools of Firefox like firebug/firepath to assist in object identification.
n

n

8. Never be too much dependent on “selenium-IDE”;don’t invest much of your learning effort on IDE. It is just a start; focus in the basic functionality of IDE and move on to build incremental and iterative automation suite using Selenium WebDriver.
n

n

9. Brush up, basic Java skills or any oops language, to make things easier while moving to real coding.
n

n

10. Never give up, take things slowly and build it step by step. Remember you need to sweat hard to achieve mastery in selenium but it is not insurmountable. 
n
n@PhotoCredit

Was this article helpful?
YesNo

Similar Posts