0

I have a scenario where i need to select a row in grid in ext-js application using selenium webdriver. Based on row selection some buttons enabled. The html snippet is as below

<div id="ext-element-55" class="x-grid-item-container" style="width: 756px; transform: translate3d(0px, 0px, 0px);" role="presentation">
    <table id="tableview-1812-record-288" class="x-grid-item x-grid-item-selected" cellspacing="0" cellpadding="0" style=";width:0" data-recordindex="0" data-recordid="288" data-boundview="tableview-1812" role="presentation">
        <tbody>
            <tr class=" x-grid-row" role="row" aria-selected="true">
                <td class="x-grid-cell x-grid-td x-grid-cell-gridcolumn-1825 x-grid-cell-first x-unselectable" data-columnid="gridcolumn-1825" tabindex="-1" role="gridcell" style="width: 378px;">
                    <div class="x-grid-cell-inner " style="text-align:1;" unselectable="on">FirstElementToSelect</div>
                </td>
                <td class="x-grid-cell x-grid-td x-grid-cell-gridcolumn-1826 x-grid-cell-last x-unselectable" data-columnid="gridcolumn-1826" tabindex="-1" role="gridcell" style="width: 378px;">
                    <div class="x-grid-cell-inner " style="text-align:1;" unselectable="on">
                </td>
            </tr>
        </tbody>
    </table>
    <table id="tableview-1812-record-289" class="x-grid-item x-grid-item-alt" cellspacing="0" cellpadding="0" style=";width:0" data-recordindex="1" data-recordid="289" data-boundview="tableview-1812" role="presentation">
        <tbody>
            <tr class=" x-grid-row" role="row" aria-selected="true">
                <td class="x-grid-cell x-grid-td x-grid-cell-gridcolumn-1825 x-grid-cell-first x-unselectable" data-columnid="gridcolumn-1825" tabindex="-1" role="gridcell" style="width: 378px;">
                    <div class="x-grid-cell-inner " style="text-align:1;" unselectable="on">SecondElementToSelect</div>
                </td>
                <td class="x-grid-cell x-grid-td x-grid-cell-gridcolumn-1826 x-grid-cell-last x-unselectable" data-columnid="gridcolumn-1826" tabindex="-1" role="gridcell" style="width: 378px;">
                    <div class="x-grid-cell-inner " style="text-align:1;" unselectable="on">
                </td>
            </tr>
        </tbody>
    </table>
</div>

WebElement Click (tried on div/tr/td/table - all elements) works fine for Chrome and FF and selects the row but it does not select row for IE. Also tried action classes, robot APIs but these also do not work on IE. Is there a way to make it work in IE using native events (apart from using javascript to select). Note that on using requiredWindowFocus it does work in IE but i do not want to use this as it has limitations of parallel work on same machine and running tests on remote locked machines.

Selenium version - 2.53.0 Browser - IE11 IE driver version 3.0

Monty
  • 5
  • 5

2 Answers2

0

Please share more details like IE version, Selenium version.

Please note there already some issues reported for Click event in IE 9, 10 and also in 11. Find more here.

Dave
  • 299
  • 1
  • 7
  • HI, Added the selenium and browser version - checked the link shared though i understand there are issues in IE related to click not sure if any of these fixed. Though one such issue suggested to use requireBrowserFocus but i want to avoid using same (because of limitation of this for remote and parallel execution). – Monty Feb 19 '17 at 11:57
0

it seems this click issue continues since IE 9. Check here.

However, please try these methods. It might be a workaround for now.

  • Change driver capabilities.
    DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer(); capabilities.setCapability("nativeEvents",false); capabilities.setCapability("ignoreZoomSetting", true); WebDriver driver = new InternetExplorerDriver(capabilities);

  • Try javascript click. Check this post.

  • Try keys.ENTER. Official docs.
    driver.findElement("path")).sendKeys(KEYS.ENTER);

Hope this helps.

Community
  • 1
  • 1
Dave
  • 299
  • 1
  • 7