1. Do check the reference manual here to get concepts of selenium locators
and the various commands that are available. You could get condensed version of the manual here.
2. Without reading the manual - You may easily miss useful commands like pause(to test session timeout), storeHtmlSource (you can potentially apply selenium regular expression to verify the values of hidden variables insides that html) , typeKeys (to do things like page up etc)
3. Assert vs verify: If you use seleniums verify command - then the test suite/case - will still run - and fail at the end. Hence in most cases you should use assert command which will cause the test to stop.
4. Sometimes selenium IDE may use "click" instead of "clickAndWait" for some "submit" button cases resulting in your next page's assert/verify to fail. Hence you should change it manually or add waitForPageToLoad with some timeout.
5. If the recording is not working - then go to firefox and click on "Tools->Add on -> Selenium IDE " .First disable it and then enable it and restart the browser. Sometimes clicking on Selenium IDEs Options->HTML Format helps.
6. If web site does not allow itself to be frameable then use -multiwidow option(instead of -interactive) with selenium rc.
7. To eliminate certificate warning(and work cross domains ) use chrome/iehta modes - which is now default(as compared with rc beta1 version) http://selenium-rc.openqa.org/experimental.html
8. If you check selenium rc options eg "java -jar selenium-server.jar -h" then you will find that it has a "timeout" option. But that timeout is for the overall run(and not for individual "clickAndWait" ) . Hence you may be advised to use "setTimeOut" via your java program or in case of HTML use -Selenium IDE open test case-> Add Insert new command -> setTimeout with value(not Target) of say 240000 (ms)
9. Selneium has this cool - captureEntirePageScreenShot command which works well with IDE/HTML . Consider using it at critical points(to debug issues, if you schedule your test cases). But with programming language like java - it may not work(try using the experimental - captureScreenshot .
10. Consider writing a wrapper for your TestCase/TestSuite in .net/jsp so that you can maintain your testcase/test suite in HTML.
11. Sometimes the browsers may not get killed after the test is run.. So you may need to manually kill it(you can try to use some automated tools to kill it on unix).
12. When your client java test (using RC) finishes with error - then it does not give clear error - you just the line number of the failed assert in stack trace - Hence you may need to trap all exceptions and - print the last body test
13. If you are testing with page where the id dynamically changes - then You may need to use lots of xpath in your test . In that case install firebug and use "Inspect element" by right clicking on the element -> Copy XPath by right click on bottom-> Add "/" in front of value you got in your clipboard-> paste this as a "target" in Selenium IDE for your "clickAndWait" command. You can check the validility by - click on find button in Selenium IDE to ensure that your XPath is correct(assuming that page is open) . You may find more tip on xpath using firebug/xpather here
14. The latest selenium rc(1.0 beta 2) does support Firefox 3. With firefox 3 you can easily add your local https server with invalid certificate in safe list(to remove warning message). Its difficult to do that with Firefox 2.
15. If you are running selenium rc test with IE a site which already has invalid certificate - then IE will give a warning for "invalid certificate". You can have selenium automatically click on "Continue" link in it(which has ID of overridelink) by adding below command in your IE specific test case.
| clickAndWait |
//a[@id='overridelink'] |
|
You need to be a member of Quality Testing to add comments!
Join Quality Testing