This section is about how to record selenium tests for Olat and how they get integrated into the nightly test infrastructure
Virtually all links in Olat are language dependent - therefore the Olat Map file is also language dependent. This means that the test will only succeed, if the current language is correctly set to English. For test recording this is best configured before start. For the nightly test framework, this is handled by the BaseSeleneseTestCase (the base test class)
Therefore: always switch to English before you start testing
Logging into Olat is going to be the first task that every test needs to execute. At the same time it is somewhat complicated since we have to make sure, that we're running in English mode.
To simplify all this, there is framework code that handles the login:
BaseSeleneseTestCase.olatLogin(selenium,url,username,password,language)
Note that by default we should be using 'English' as the test language since the olat-ui-map file only works with English
What this means for test recording in Selenium IDE is, that the input for the automated Selenium test classes only need the part after the login
As described in the Olat Map file section earlier, tests are only maintainable if they don't use XPaths/Id-Links directly, but use the Olat Map file with their UI-Element locator notation (ui=dmz::username()). When recording tests Selenium IDE most of the times finds corresponding mapped locators and automagically records Ui-Element locators instead of XPaths or IDs. If that's the case then everything is fine. You will surely come across non-encoded locators though - or special cases which are UI-Element locators that are parametrized. In these cases you must manually fix the locator
Here's a list of known parametrized UI-Element locators:
ui=learningResources::content_clickCourseEntry(nameOfCourse=Demo course wiki)
ui=tabs::closeCourse(nameOfCourse=Demo course wiki)
ui=course::menu_link(link=Wiki sandbox)
Therefore: always use locators that start with ui= and add it to the olat-ui-map.js if the link is not encoded yet
A Selenium test recorded in Selenium IDE can be stored in a Selenium-own format (HTML) or converted into any programing language.

Supported conversion formats in Selenium IDE
The process of converting a Selenium IDE test into a nighlty olat selenium test is as follows:
Record and store the test in Selenium IDE's own HTML format

The test example
Convert the test into Java

The test example converted into Java. The green box marks the relevant part
Extract the relevant part (marked green above) and put it in a Junit class:
package org.olat.test.tutorial.singlenode.junit;
import org.olat.test.util.selenium.BaseSeleneseTestCase;
public class TutorialTestTest extends BaseSeleneseTestCase {
public void setUp() throws Exception {
selenium = connect("idmels04.unizh.ch", "*chrome", "https://nightly.olat.uzh.ch/nightly/dmz/");
}
public void testNew() throws Exception {
olatLogin(selenium, "https://nightly.olat.uzh.ch/nightly/dmz/", "administrator", "******", "English");
assertEquals("OLAT - Home", selenium.getTitle());
selenium.click("ui=tabs::learningResources()");
selenium.waitForPageToLoad("30000");
selenium.click("ui=learningResources::menu_courses()");
selenium.waitForPageToLoad("30000");
selenium.click("ui=learningResources::content_clickCourseEntry(nameOfCourse=Demo course wiki)");
selenium.waitForPageToLoad("30000");
selenium.click("ui=learningResources::content_showContent()");
selenium.waitForPageToLoad("30000");
selenium.click("ui=tabs::closeCourse(nameOfCourse=Demo course wiki)");
selenium.waitForPageToLoad("30000");
assertEquals("OLAT - Learning resources", selenium.getTitle());
}
}