-
1. Re: Selenium tests and click in extendedDataTable
nbelaevski Apr 12, 2010 6:32 AM (in response to mettehummel)Hi Mette,
Iteration components use "rowKey" property of the ExtendedDataModel to create clientId for the iterated components. I can guess that in your case no.skd.sl.domain.GldKodeBeskrivelse@f99f26 is rowKey.toString() of the custom model key. So, you can use simpler keys (e.g. Integer) or define "rowKeyConverter" that will handle keys.
-
2. Re: Selenium tests and click in extendedDataTable
mettehummel Apr 12, 2010 7:52 AM (in response to nbelaevski)Thanks, but how do I set up a rowKeyConverter?
-
3. Re: Selenium tests and click in extendedDataTable
lfryc Apr 12, 2010 10:09 AM (in response to mettehummel)Hello Mette,
from your sample it seems that you are addressing problem with changing IDs of elements, because the ID is generated by toString() method. This method generates unique object instance representation, however this ID will be changed between another instances of JVM.
You have two options here:
1. you can find another way how to address the element without need for specific ID, for example by using XPath:
sample: http://livedemo.exadel.com/richfaces-demo/richfaces/extendedDataTable.jsf
example xpathes for "Arkansas" row:
//div[contains(@class,'extdt-content')]/table/tbody/tr[4]
//div[contains(@class,'extdt-content')]/table/tbody/tr[td[2]/div/text()='Arkansas']
2. you can change underlying application, for example as suggested Nick you can use rowKeyConverter, from documentation:
<rich:extendedDataTable ... rowKeyConverter="#{myConverter}" />
where myConverter must evaluate to
javax.faces.convert.Converter
This converter must to convert given row key (from data model) to unique string representation and vice-versa.
-
4. Re: Selenium tests and click in extendedDataTable
mettehummel Apr 14, 2010 2:41 AM (in response to lfryc)Thanks!
The xpath suggestion worked fine. I added the following Selenium test which made Selenium click on the third column of the first row:
clickAt xpath=id('hovedForm:gldKodeTabell:n:0')/x:td[3]/x:div/x:input/