1
votes

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?

1
Both first two locators look ok, they should match it (the 3rd is too broad, will match all elements in that branch). Are you sure this html is not in a frame?Todor Minakov
No. Its not inside any new frame. I can access elements next to this kendo buttons.Ramesh Babu M S

1 Answers

1
votes

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