Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The tests must all be stored in the suite folder. Give each one a meaningful name. For example: CreateNewUser.html

...

Open Selenium

*{+}TBD{+}**

  • Set the base URL

...

Create the suite

*{+}TBD{+}**

  • Store in a directory under suites

...

  • Call it Suite.html

...

Create a test

*{+}TBD{+}**

  • Click "Record"

...

  • Go through it.

...

  • Click to Stop Recording.

...

Edit the test

*{+}TBD{+}**

  • Add comments

...

  • Change the starting URL

...

  • Sometimes need to change "click" command to "clickAndWait"

...

  • Sometimes need to add "wait" command

...

  • Add other assertions (verifyElementNotPresent)

...

Confirm that it works

*{+}TBD{+}*h2.

Commit to Subversion

*{+}TBD{+}*h1.

Tips for working with Selenium

*{+}TBD{+}*

How to open the Test Suite panel (not immediately obvious): !OpenSuitepanel.jpg|thumbnail!
h1.

Image Added

Tips for writing tests

*Auto Logout* \\ 
If your test begins by logging in, put a {{deleteAllVisibleCookies}} command right at the beginning. This makes sure that you are not logged in to VIVO. If an earlier test failed and didn't logging out, this will prevent your test from failing on the login attempt.*

Default selection* \\
If a form includes a selection box which defaults to the value you want, it might make sense to explicitly select that value in the test anyway. Then, if the default value changes, the test will still work.

*Links with the same name* \\
Be sure that the locators in the tests are specific enough. An instruction to click on {{link=Add}} probably won't work if there are several links named "Add" on the page. You may need to use a more elaborate locator, like {{//div\[@id='oprop-core-linkedAuthor'\]/a}}*

Entering "Rich Text"* \\ 
When you enter text into a "Rich Text Editing" area, also known as a TinyMCE frame (see image below), Selenium will not record your input. You must manually insert a command into the test, like this:{noformat}
type    tinymce    This

Code Block
type    tinymce    This is my text

is my text
{noformat}
If there is more than one Rich Text area on a single page, this may not work. So far, I haven't see seen that.!example of rich text editing.png|thumbnail!
h1.

Image Added

Additional information

...

Selenium IDE

This is the definitive introduction to the IDE. Lots of good stuff here. Please remember to install from your VIVO work area, and not from the download.

[Selenium IDE documentation | http://seleniumhq.org/docs/03_selenium_ide.html]

Similarly, this is the definitive reference to the Selenium command language (Selenese). Also plenty of detail about locating elements within a page.[

Selenium Commands | http://seleniumhq.org/docs/04_selenese_commands.html]h2.

XPath:

For more powerful means of specifying elements or[

XPath tutorial with copious examples | http://www.zvon.org/xxl/XPathTutorial/General/ examples.html][

More examples | http://msdn.microsoft.com/en-us/library/ms256086.aspx][

Another XPath tutorial | http://www.w3schools.com/XPath/default.asp][

A quick reference card | http://www.xml.dvint.com/docs/XPath-2.pdf][

Some tips for using XPath | http://www.xml.com/lpt/a/1018]