This is still a draft based on a personal understanding. Selenium RC developers should confirm this before it is final.
Parts Involved
There are four main processes involved in the run of a Selenium RC test, test code (using Ruby as example here), selenium server instance, testing browser instance, and web application under test
Code
@sel = Selenium::SeleniumDriver.new("localhost", 4444, "*chrome", "http://www.google.com", 15000) @sel.start @sel.open("http://www.google.com") @sel.type("q", "hello world") ... @sel.stop
Sequence Chart
Here is a poor man's version of the sequence diagram for a Selenium test run in Ruby
| Ruby test code | Data Flow | Selenium Server | Data Flow | Browser |
|---|---|---|---|---|
| running | ||||
| @sel = ...new.. | ||||
| @sel.start | ---> | |||
| starts browser | ---> | |||
| waits | starts | |||
| <--- | connects to selenium server | |||
| <--- | returns new session id | |||
| (stores session id) | ||||
| @sel.open | ||||
| (sends open command with session id) |
--> | |||
| forwards command as reply to browser | ----> | |||
| selenium core processes command, performs the action | ||||
| <--- | sends result as another request in the same session | |||
| processes result | ||||
| <--- | sends result back to test process | |||
| @sel.type | ||||
| (sends type command with session id and arguments) |
--> | |||
| forwards command as reply to browser | ----> | |||
| selenium core processes command, performs the action | ||||
| <--- | sends result as another request | |||
| processes result | ||||
| <--- | sends result back to test process | |||
| ... | ||||
| ... | ||||
| @sel.stop | ||||
| (sends type command with session id) |
--> | |||
| shuts down browser | ||||
| <--- | ends sessions | |||
| ... |
