IE browser does not support Action class. Is it possible to multi select the items in a table using any other way? If any, please share.
Please find the sample structure of the table to select the values. Now i want to select the Text1, Text3 & Text5 values. Am able to select using Action class in Chrome, FF browser using selenium 2.52.0 but not able to select in IE/Safari.
<table>
<tr><td><div><span>Text1<span/><div/><td/><tr/>
<tr><td><div><span>Text2<span/><div/><td/><tr/>
<tr><td><div><span>Text3<span/><div/><td/><tr/>
<tr><td><div><span>Text4<span/><div/><td/><tr/>
<tr><td><div><span>Text5<span/><div/><td/><tr/>
<table>
Function used to click:
String[] items = itemName.split("\n");// Items to be clicked
Actions builder = new Actions(driver);
for(int counter = 0; counter < items.length; counter++)
{
this.listingRows = this.listing.findElement(By.cssSelector("table[id='mainTable']"));
List<WebElement> element = listingRows.findElements(By.cssSelector("tr[class='sample']>td>div>span")); //Getting the row elements
int itemCnt = element.size();
String item;
for(int i =0;i<itemCnt;i++){
item = element.get(i).getText();
if(item.equalsIgnoreCase(items[counter])){
builder.keyDown(Keys.CONTROL).click(element.get(i)).keyUp(Keys.CONTROL);
builder.build().perform();
}
}
}