hello,
i have a problem, i am trying to write a custom code that will take value from user and click on the value in the drop down list to add widget. so far my code is
public static void AddWidget(RepoItemInfo selecttaginfo, string widgetname)
{
var repo = BottomLineIIRepository.Instance;
var widgetbox = repo.DigitalBanking.widgetbox;
var option1 = repo.DigitalBanking.Payees.option;
repo.DigitalBanking.widgetbox.Click(); <-this is clicking the drop down box
option1.Element.SetAttributeValue("label",widgetname); <-here i want to click on the innertext or label of option provided by the user
option1.Click();
}
there are 15 widgets so i have 15 test cases. i will use the code in all the test cases to add relevant widget.
please help.
Code for Adding from the dropdown list
Code for Adding from the dropdown list
You do not have the required permissions to view the files attached to this post.
Re: Code for Adding from the dropdown list
Hi,
I see you are using Chrome. And the problem is, that Chrome (from all browsers) does not have the individual select list options recognizable by Ranorex (any UI TA tool). It's because of the way Chrome creates the select list. So, there is unfortunately no use for standard "click selectbox -> click desired select option" sequence in Chrome.
What you can do, is to create a repo item pointing to the select tag of your choice, which should have xpath like this (based of the provided snapshot):
I see you are using Chrome. And the problem is, that Chrome (from all browsers) does not have the individual select list options recognizable by Ranorex (any UI TA tool). It's because of the way Chrome creates the select list. So, there is unfortunately no use for standard "click selectbox -> click desired select option" sequence in Chrome.
What you can do, is to create a repo item pointing to the select tag of your choice, which should have xpath like this (based of the provided snapshot):
Now you simple add 'Key Sequence' action, targeted to the above select tag. And then add a variable, containing the value you want to select. And that's all. You don't even have to use code True, it's not a typical user-like action, but at least this technique works across all browsers! Courtesy of forum member krstcs/dom[@domain='6012-sbx.btbanking.com']//div[#'SMBHOME']//form[@name='widget-injector-form']/select[@name='widget-injector']
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Code for Adding from the dropdown list
thank you sir.