This is a WebDriver remote end written in .NET CF 3.5 for C# Windows CE / Windows Mobile 6.5 Web server is intended to be used for RESTful web services
-
Ensure you can connect to your WM6.5 device over Wi-Fi (assigning static IP also helps).
-
Deploy
SimpleWebDriver
to a WM6.5 device (ensure .NET CF 3.5 is installed on it), then run the executable. -
Deploy
SimpleWinceGuiAutomation.AppTest
to the device (don't run it) -
Build and run
SimpleWebDriver.Tests
from command line:
$ SimpleWebDriver.Tests.exe <IP> <PORT>
where
<IP>
stands for IP adress of the device<PORT>
stands for the port the webserver is listening on (8080
by default)
Run some scripts following the webdriver protocol.
-
session create / delete (limitation: single app at a time!)
-
status
-
get title
-
source (get the object tree the driver is operating against as JSON)
-
screenshot (both full-screen and selected element)
-
single and multi-element queries
- css selector
- link text, partial link text
- tag name
-
element state requests (rect, enabled, selected, text, name)
-
element interaction (send keys & clear, click)
We translate some WinForms controls to their HTML counterparts:
WinForms | HTML |
---|---|
Button | button |
TextBox | input[type="text"] |
ComboBox | select |
CheckBox | input[type="checkbox"] |
ListBox | ul |
Label | label |
Radio | input[type="radio"] |
Therefore, we can translate some CSS selectors to queries over the WinAPI window hierarchy:
- you can match by tag name (e.g.
button
,panel
), optionally suffixing an attribute query (e.g.[type="checkbox"]
) - next, you can combine the expressions from above with these operations (left-associative):
A > B
(select direct children of A matching B)A B
(select descendants of A matching B)A ~ B
(select sibling of A that matches B)A + B
(select immediate sibling of A that matches B)
Since it is not clear from WinAPI how to order windows, to define the "document order", we just sort all controls by Top then Left coordinates.
- SendKeys doesn't support characters beyond Latin
- It's still WinAPI so there isn't too much info about controls
- if your custom controls are not WinAPI-friendly, you may not be able to test them!
- Only one app at a time (can be changed, if needed)
WinCeWebServer SimpleWinCeGuiAutomation
WebDriver implementation contributed by Artyom Shalkhakov (artyom DOT shalkhakov AT gmail DOT com)