UIPicker Button 'Done' isn't working
Posted: Sat Jan 23, 2016 1:02 am
Hello,
I'm trying to select a item from UIPicker. The method Select() works fine, but when I touch the button 'Done' the selection isn't completed. The last value on ListItem still.
This is my code:
public void SelectItemListBox(string elementToFocus, string itemName){
/************************************************************************
* Function : SelectItemListBox(string elementToFocus, string item){
*
* Description : This method select an item from Iphone UI list
*
* Parameters : elementToFocus - Element to touch and make visible the UIPicker
* : itemName - Item to select
*
* Return Type : N/A
*
* Return Value : N/A
*
* Revision History
* Date : Author : Reason/Change
* ---------- : ------------------------- : ------------------------------
* 15/01/2016 : Wellington Santana : Initial Creation
************************************************************************/
try {
Report.Log(ReportLevel.Info, "Select", "Selecting the item " + itemName);
Ranorex.SelectTag element = elementToFocus;
element.Touch();
ListItem item = "/mobileapp[@title='ranorex.RxBrowser']/form//iospicker/list[@accessibilitylabel='Component 0']/listitem[@accessibilitylabel='" + itemName +"']";
item.Select();
Ranorex.Button done = "/mobileapp[@title='ranorex.RxBrowser']/form/container[2]//toolbar/button[@accessibilitylabel='Done']";
done.Touch();
} catch (Exception e) {
Report.Error("Error selecting the item" + itemName + " from element: " + elementToFocus + "");
Console.WriteLine(e.ToString());
Report.Screenshot();
}
}
I'm using Ranorex 5.4.4 and testing in Iphone 5s (IOS 9.2.1).
No errors while executing.
I'm trying to select a item from UIPicker. The method Select() works fine, but when I touch the button 'Done' the selection isn't completed. The last value on ListItem still.
This is my code:
public void SelectItemListBox(string elementToFocus, string itemName){
/************************************************************************
* Function : SelectItemListBox(string elementToFocus, string item){
*
* Description : This method select an item from Iphone UI list
*
* Parameters : elementToFocus - Element to touch and make visible the UIPicker
* : itemName - Item to select
*
* Return Type : N/A
*
* Return Value : N/A
*
* Revision History
* Date : Author : Reason/Change
* ---------- : ------------------------- : ------------------------------
* 15/01/2016 : Wellington Santana : Initial Creation
************************************************************************/
try {
Report.Log(ReportLevel.Info, "Select", "Selecting the item " + itemName);
Ranorex.SelectTag element = elementToFocus;
element.Touch();
ListItem item = "/mobileapp[@title='ranorex.RxBrowser']/form//iospicker/list[@accessibilitylabel='Component 0']/listitem[@accessibilitylabel='" + itemName +"']";
item.Select();
Ranorex.Button done = "/mobileapp[@title='ranorex.RxBrowser']/form/container[2]//toolbar/button[@accessibilitylabel='Done']";
done.Touch();
} catch (Exception e) {
Report.Error("Error selecting the item" + itemName + " from element: " + elementToFocus + "");
Console.WriteLine(e.ToString());
Report.Screenshot();
}
}
I'm using Ranorex 5.4.4 and testing in Iphone 5s (IOS 9.2.1).
No errors while executing.