1

robot framework not identifying kendo button

when i try click on kendo button, robotframework throws "element not found" error. I tried with selenium also. Response is same.

Tried below xpaths,

    xpath://*[@id='btn-ctrl-grp']//span[contains(text(),'WARM')]

    //*[@id='btn-ctrl-grp']/li[3]/span

    xpath://*[contains(text(),'WARM')]

my html page contains below kendo elements

    <li id="header-col5">

        <div id="header-navigation">

            <ul id="btn-ctrl-grp" style="padding:0px;margin:0px;" data- 
             role="buttongroup" class="km-widget km-buttongroup k-widget 
             k-button-group">

            <li class="btn-ctrl ng-binding ctrl-btn-inactive k-button km- 
            button" ng-disabled="reqCtrlMode == 1 || header.appStatus == 
            'INACTIVE'" ng-class="onButtonClass">

            <span class="k-text km-text">ON</span></li>

            <li class="btn-ctrl ng-binding k-button km-button ctrl-btn- 
            offbtn k-state-active km-state-active" ng- 
            disabled="reqCtrlMode == 0 || header.appStatus == 'INACTIVE'" 
            ng-class="offButtonClass" disabled="disabled">

            <span class="k-text km-text">OFF</span></li>

            <li class="btn-ctrl ng-binding ctrl-btn-inactive k-button km- 
            button" ng-disabled="reqCtrlMode == 11 || header.appStatus == 
            'INACTIVE'" ng-class="warmButtonClass">

            <span class="k-text km-text">WARM</span></li>
            </ul>
        </div>
    </li>

can anyone guide me on how to handle kendo controls in robotframework?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

1

To click() on the kendo button with text as WARM you can use the following xpath based solution:

//ul[@class='km-widget km-buttongroup k-widget k-button-group' and @id='btn-ctrl-grp']//span[@class='k-text km-text' and text()='WARM']

Note: The element is an Angular element, so you have to induce WebDriverWait for the element to be clickable

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    Thanks. I'm able to find the element. But its failing to click. I can see click is happening, but the popup is not coming up.I faced similar issue with selenium on IE 11 in WIN 10 (click fails on WIN 10 IE11). But it works fine in Win 7 IE 11. Same issue is there with robot framework as well? – Ramesh Babu M S Apr 05 '19 at 09:22
  • I don't do [tag:robotframework] much, perhaps this [discussion](https://stackoverflow.com/questions/48948930/robotframework-selenium2lib-wait-until-keywords/48963864#48963864) can help you. – undetected Selenium Apr 05 '19 at 09:26
  • 2
    That locator is REALLY bad and brittle. `//ul[@id='btn-ctrl-grp']//span[.='WARM']` would be enough to locate that element. – JeffC Apr 05 '19 at 20:47