Friday, January 25, 2013

Re: Debug Id (or equivalent) for CellTable elements?

Unfortunately that isn't a real possibility with the way our project is setup. What we ultimately need to do is something along the lines of "Find the first column in the table at the row where the second column has the text ______". If the cell and/or column elements could use the UIObjects debugId stuff, that would be very easy as the cell's have access to the actual object that is put into the row.

Performance isn't the real issue; it's the fact that writing unit tests that are completely dependent on aspects of the table that can be very easily changed (such as CSS class, visible text, column ordering, etc.) is not a path that w want to take. What we have been doing to find UiObjects around the site is calling widget.ensureDebugId() using constant strings, or if the content is dynamic, some sort of knowable addressing scheme (such as formname-username). Unfortunately, there isn't any way to do this on cell or column elements.

On Friday, January 25, 2013 9:14:53 AM UTC-5, Lukasz Plotnicki wrote:
What about using XPath and combining different attributes,e.g 

driver.findElement(By.xpath("//div[contains(@class,'menuTitle') and contains(.,'Register Menu')]"))

We are using it and are quite happy as it is panel/layout-structure independent. The performance is not as good as with By.id, but acceptable. 


Am Donnerstag, 24. Januar 2013 15:16:08 UTC+1 schrieb jacob....@gmail.com:
Hi,

I'm trying to setup Selenium unit testing for my project, and I'm wondering if there is any equivalent to UiObject.ensureDebugId() for elements in a CellTable, such as Column, Header, or any of the various Cell types. What I have been doing is override the Column.render() method to dynamically insert a div with an ID that I can find later, but this seems very hacky and counter-intuitive. I can't seem to find any way to do this for the Header element though.

Using xpath to find elements in the table is not an option, as our unit tests can't be tied to the structure of the GUI staying exactly the same. For the same reasons, trying to find elements by text or tag name (etc. etc.) wouldn't work either.

Is there something I'm missing here, or do the CellTable elements not provide this functionality?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate