Testing DataTables with SeleniumIDE
Testing DataTables with SeleniumIDE
LeadVisionary
Posts: 8Questions: 0Answers: 0
I've noticed strange behavior with SeleniumIDE 1.0.7 and DataTables 1.4.0 beta 9 (yes this is old. Not sure if this has been fixed by now, as forum shows no posts with Selenium) on Firefox 3.6.10.
When trying to use search textbox, one needs to use the Selenium "type" and "typeKeys" commands to allow the DataTable to catch up to filtered search results (as suggested in the Selenium documentation). This works fine in writing a test on one tab, as the text appears in the textbox only once. But when running the test with another open tab, the text is entered in twice.
Can anyone replicate this? I don't know of sites that use DataTables other than the one I'm testing, so I don't know if it's something application specific or tool specific? If so, do we know what the issue is? Is there a workaround?
When trying to use search textbox, one needs to use the Selenium "type" and "typeKeys" commands to allow the DataTable to catch up to filtered search results (as suggested in the Selenium documentation). This works fine in writing a test on one tab, as the text appears in the textbox only once. But when running the test with another open tab, the text is entered in twice.
Can anyone replicate this? I don't know of sites that use DataTables other than the one I'm testing, so I don't know if it's something application specific or tool specific? If so, do we know what the issue is? Is there a workaround?
This discussion has been closed.
Replies
Allan
type //input[@value=''] blah
typeKeys //input[@value=''] blah
where the text would be written once in the search box of that tab, but when tab B was opened and the test was run, it would be written twice in the input of that tab. I can't seem to replicate it now with a simpler base case, though, so it may have just been "strange, middle of the night behavior."
...though i would suggest that attaching an id to that textbox (i.e. "search_box") and making it an exposed, user-configurable property would be a useful modification.
DataTabels will attach "{table_id}_filter" as the ID for the DIV in which the input is (if your table has an ID). So you can do $('example_filter input') for example to get the input element.
Allan