I am running Ranorex 5.0.1 on a Win7 machine and am having problems setting the value for a Flex drop down. I am trying to use the Set Value/SelectedItemText to set the value, but nothing is happening. I used the spy to look at the drop down with my deisred item selected so I could see the value of SelectedItemText to be sure I was using the correct value. I have used this on another flex drop down before with success, so I am not sure what is different about this one. The option I am trying to select is deep in the list so I'm not able to access it by just clicking on the drop down and selecting it. Below is the code as Ranorex produced it after I added the line via the studio.
Report.Log(ReportLevel.Info, "Set Value", "Setting attribute SelectedItemText to 'PM1, BPM' on item 'CCIsites.UploadProjects.Shell.topBoxScroller.PROJECTMANAGER'.", repo.CCIsites.UploadProjects.Shell.topBoxScroller.PROJECTMANAGERInfo, new RecordItemIndex(58))
repo.CCIsites.UploadProjects.Shell.topBoxScroller.PROJECTMANAGER.Element.SetAttributeValue("SelectedItemText", "PM1, BPM")
Delay.Milliseconds(0)
Set Value - SelectedItemText not working for my drop down
Set Value - SelectedItemText not working for my drop down
- Attachments
-
- Spy.rxsnp
- Ranorex Snapshot of Application
- (313.64 KiB) Downloaded 182 times
Re: Set Value - SelectedItemText not working for my drop down
Hi acalhoun,
many times setValue is not working, since it does not trigger the events it should. Either try to use mouse click, or try to find out what event should be fired and do them from code (Although I am not sure how can this be done in flex - in javascript Ranorex can trigger javascript event, so there is a possibility to hav a solution for flex elements also).
Regards,
Zoltán Major
many times setValue is not working, since it does not trigger the events it should. Either try to use mouse click, or try to find out what event should be fired and do them from code (Although I am not sure how can this be done in flex - in javascript Ranorex can trigger javascript event, so there is a possibility to hav a solution for flex elements also).
Regards,
Zoltán Major
Re: Set Value - SelectedItemText not working for my drop down
Hi,
As you have mentioned that the item you are trying to select is present some where bottom of the drop down list.So use focus(),Select() first to select the item.Then use click() to select the item from drop down list
Thanks,
Rakesh
As you have mentioned that the item you are trying to select is present some where bottom of the drop down list.So use focus(),Select() first to select the item.Then use click() to select the item from drop down list
Thanks,
Rakesh
Re: Set Value - SelectedItemText not working for my drop down
Hi Rakesh,
Thanks for the suggestion, but when I try to do a Select() on the text item in the drop down it tells me the operation is not supported. For now, I have just recorded scrolling down in the list until my option is visible, although I know that will not hold up over time.
Thanks for the suggestion, but when I try to do a Select() on the text item in the drop down it tells me the operation is not supported. For now, I have just recorded scrolling down in the list until my option is visible, although I know that will not hold up over time.
Re: Set Value - SelectedItemText not working for my drop down
Hi,
Can you share your code?Then we can come with some solution
Thanks,
Rakesh
Can you share your code?Then we can come with some solution
Thanks,
Rakesh
Re: Set Value - SelectedItemText not working for my drop down
Hi acalhoun,
someone shared a solution about select controls. Basically the code uses the keyboard to select the element:
http://www.ranorex.com/forum/unable-to- ... t3413.html
And here are some more reading about the subject:
http://www.ranorex.com/forum/post9801.html
http://www.ranorex.com/forum/post18920.html
http://www.ranorex.com/forum/triggering ... t3206.html
The select control could be a hard nut to crack, since even the standard HTML select control is implemented differently in IE, chrome and FF. So one solution that works in FF, many times not working in IE.
Best Regards,
Zoltan
someone shared a solution about select controls. Basically the code uses the keyboard to select the element:
http://www.ranorex.com/forum/unable-to- ... t3413.html
And here are some more reading about the subject:
http://www.ranorex.com/forum/post9801.html
http://www.ranorex.com/forum/post18920.html
http://www.ranorex.com/forum/triggering ... t3206.html
The select control could be a hard nut to crack, since even the standard HTML select control is implemented differently in IE, chrome and FF. So one solution that works in FF, many times not working in IE.
Best Regards,
Zoltan