Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98807

kendo combobox with selenium Java

$
0
0

I am trying to automate Kendro UI application using selenium. I am not sure if the selenium is the right tool to use for Kendro UI application.

Could you please help me to select a Kendro UI Combobox dropdown value with selenium.

I have tried multiple ways and none of them worked so far.

My Code: I clicked on the arrow from the dropdown and wait for few seconds and then try to select a value. But the issue is, for some reason, dropdown it works 4 out of 10 times. So this is not a right solution

WebElement firstDropDown = driver.findElement(By.xpath("//innova-combobox-input[@name='LHSCID']//span[@class='k-select']"));

firstDropDown.click();
new WebDriverWait(driver,50).until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[contains(text(),'LHSC 1000 Technician Site A')]")))

driver.findElement(By.xpath("//span[contains(text(),'LHSC 1000 Technician Site A')]")).isDisplayed();
driver.findElement(By.xpath("//span[contains(text(),'LHSC 1000 Technician Site A')]")).click();

Below is HTML code on the page for the dropdown:

<input name="{{::$ctrl.name}}_input" class="k-input innova-invalid" type="text" autocomplete="off" title="" role="combobox" aria-expanded="false" style="" tabindex="0" aria-disabled="false" aria-autocomplete="list" aria-owns="" aria-busy="false" aria-activedescendant="d5147cf1-35ff-4160-ad0f-c164916f59c7" xpath="1">

And The dropdown values

<ul unselectable="on" class="k-list k-reset" tabindex="-1" aria-hidden="true" aria-live="polite" data-role="staticlist" role="listbox" style="" xpath="1">
<li tabindex="-1" role="option" unselectable="on" class="k-item k-state-focused" data-offset-index="0" id="d5147cf1-35ff-4160-ad0f-c164916f59c7" style=""></li>
<li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="1">
<span ng-bind="dataItem.Display"></span>
</li>
<li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="2" style=""></li>
<li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="3"></li>
<li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="4"></li>
<li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="5"></li>
<li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="6"></li>
<li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="7"></li>
<li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="8"></li>
</ul>

Viewing all articles
Browse latest Browse all 98807


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>