websharper element ids

238 Views Asked by At

We plan to use WebSharper for our web interface. The problem is that our integration tests are based on selenium and use the ids of the page elements for clicking and filling data.
For this reason we need to be able to specify ids for all the relevant elements in the page.

For non-form elements we can do this: A [HRef (ctx.Link Home)] -< [Text "Home" ] -< [Id "home"]

How can we do it for the input fields inside a formlet?

Thanks

UPDATE: In the end we decided not to use websharper formlets. One reason is that we can't assign IDs to form elements and thus our testing method doesn't work anymore. The other reason is the table based layout which don't fit well in our design. We will still use websharper but without formlets library

1

There are 1 best solutions below

1
On

Why you explicitly need to use id's for selenium tests? I am certain that you know this but I will put link http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/By.html.

From my xp xpath is more reliable than id's and I saw pages where was plenty of same ids (although I scraped wild web not internal application :-) )