Click at a scrollable data table with watir
Is there anyway of marking several different ro开发者_Go百科ws in a scrollable data table ?
I know how to mark one row b.div(:id, "listProductsForm:productList:bc_4_0").click
I just want to simulate the "Ctrl"- button is pressed down
How does your "scrollable data table" looks like? Show us the HTML. I see that you are using div tag to access one element.
You probably need to fire some JavaScript event. See How to find out which JavaScript events fired?
The chances are good that you will need to use a combination of Watir::IE.send_keys() and the click actions on the document.
Try something like this:
@browser.send_keys("{CTRLDOWN}")
@browser.div(:id, "listProductsForm:productList:bc_4_0").click
@browser.div(:id, "listProductsForm:productList:bc_5_0").click
@browser.send_keys("{CTRLUP}")
Watir API documentation: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000497
The documentation above links to the specific key commands that can be sent. I'm pretty sure this will require that you have AutoIt installed.
精彩评论