Im stuck in my project today with a small issue , i need to hold the Control Key for a while and select the {n} number of rows.
Below is my code snippet any help is really appreciated .
!!!...I want hold the control key click on a row ,then click on the other row and finally release the control key ...!!!
while (enclosure_count_remove > 0)
$browser.element(:xpath,"//table[@id ='selectConfiguration']/tbody/tr[0]").click(:control);
$browser.element(:xpath,"//table[@id ='selectConfiguration']/tbody/tr[1]").click(:control);
enclosure_count_remove -= 1;
end
And the second way i tried is given below
while (enclosure_count_remove > 0)
$browser.send_keys :control
$browser.element(:xpath,"//table[@id ='selectConfiguration']/tbody/tr[0]").click;
$browser.element(:xpath,"//table[@id ='selectConfiguration']/tbody/tr[1]").click;
enclosure_count_remove -= 1;
end
Both are not working for me, every time im able to click but failed to hold and click both the entities .
Thanks!
Aditya
After looking at the watir-webdriver Element.click() method, I think you have to use the webdriver action builder directly. Try this:
I do not have a webpage to test this so am going purely based on documentation.