QA/Execution/Web Testing/Selenium Guidelines: Difference between revisions

no edit summary
No edit summary
Line 1: Line 1:
Here be some Selenium guidelines (mostly for writing, but include running here too).
Here be some Selenium guidelines (mostly for writing, but include running here too).
=Some good practices=
*Give meaningful names to test cases.Example:"Advanced search test case" is a very vague name which does not specify what exactly you intend to verify. "Verify platform specific search for firefox addons" is more specific.
*Give meaningful names to variables. This will make it easier to maintain the test case in the longer run.
*It's best to check if you are logged in at the beginning of every test case.
At the end of the test case,always logout.


=IDE=
=IDE=
Line 6: Line 17:
** e.g. ...
** e.g. ...
* wherever possible, use relative--not absolute--URLs in |open| commands
* wherever possible, use relative--not absolute--URLs in |open| commands
*Store xpath you use in the testcase in variables at the beginning of the testcase and use the variable whenever you need to use the xpath.This way,if you ever need to change the xpath,you change it only once at the top of the testcase.
*Add an echo statement after every assertion.
*StoreXpathCount  command can be used to find the number of elements having a similar xpath.
*VerifySelectedLabel can be used to verify the selected option in a dropdown box.
=PHP=
=PHP=
* Locating elements
* Locating elements
Confirmed users
1,477

edits