i am new to appium, have setup appium for automation.
i am facing the following issue:
How to select a value for drop down( kendo control). this drop down is kendo control ( kendo renders the control in custom format. this control is combination of multiple HTML controls).
since this dropdown is render as UIAStaticText , i am not able to set the value for this drop down.
could you please help to identify this as drop down?
is there any way to convert this control to dropdown
My code:
Select dropdown = new Select(driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAWebView[1]/UIAStaticText[7]")));
dropdown.selectByIndex(1);
Thread.sleep(5000);
Error:
FAILED: Mytest1
org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been âselectâ but was âUIAStaticTextâ
Build info: version: â2.43.1â, revision: â5163bceâ, time: â2014-09-10 16:27:33â
System info: host: âQAs-Mac-mini.localâ, ip: â10.47.86.154â, os.name: âMac OS Xâ, os.arch: âx86_64â, os.version: â10.10â, java.version: â1.8.0_20â
Driver info: driver.version: unknown
Select dropDown = new Select(driver.findElement(By.xpath("//UIAStaticText[@label=âAll Stationsâ]")));//or you can use â//UIAStaticText[@name=âAll Stationsâ];â
dropdown.selectByIndex(1);
Hope this helps you , Please let me know if youâre able to done with the same.
i tried as you said, but did not help. i am getting âSessionNotFoundExceptionâ
tried with both label and name
CODE:
Thread.sleep(50000);
Select dropdown = new Select(driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAWebView[1]/UIAStaticText[@name =âAll Stationsâ]")));
dropdown.selectByIndex(1);
Hi @souji ,
I guess Select class maynât work for your caseâŚPlease try with click on that element by using driver.findElement(By.xpath("//UIAStaticText[@label=âAll Stationsâ]")).click(); and again perform click on option Element.
this works !!!
driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAWebView[1]/UIAStaticText[7]")).click();
driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAWebView[1]/UIAElement[2]")).click();