tags:

views:

63

answers:

2

Is there anyway of marking several different rows 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

A: 

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?

Željko Filipin
A: 

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.

JEH
Thank you, it work sooooo fine :)
Great. Please accept the answer if it solved your problem.
JEH