On change select troubles

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
generalecaster
Posts: 20
Joined: Thu May 09, 2013 10:44 am

On change select troubles

Post by generalecaster » Mon Aug 05, 2013 11:05 am

Hi all,

I'm having some troubles with select box.
First, I'm using Ranorex ver. 4.0.4.
I need to select an option in my select, and I'm using Set Value/Tag Value that works fine. The problem is that browsers (I'm working on a multi-browser application) can't run the "on change" associated code.
In this moment I'm using a horrible piece of code that simulated so much {down} on my select until reaching my option, but I know that someone may call police for this :D ...
What I'm asking for is a way to solve this.

Thanx a lot for help and sorry for my english
Max

generalecaster
Posts: 20
Joined: Thu May 09, 2013 10:44 am

Re: On change select troubles

Post by generalecaster » Mon Aug 05, 2013 2:09 pm

Ok, I'm trying several ways to solve my problem, but without success ...

a simple question: I have this code:

Code: Select all

        		SelectTag select = (SelectTag)tendina;
        		OptionTag item = (OptionTag)elementoInLista;
where select is my select box and item the option tag I need to select.
May I retrive a list of OptionTag from my SelectTag?
I've tryed

Code: Select all

select.Children;
but it returns a IList<Unknown> and I can't cast Unknown with an OptionTag.

So I've tryed

Code: Select all

select.Children.GetEnumerator();
because in its tooltip I've read

Code: Select all

public IEnumerator<OptionTag> GetEnumerator()
but it's not true, because it returns a IEnumerator<Unknown> ...

can someone help me?

thanx
Max

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: On change select troubles

Post by Support Team » Tue Aug 06, 2013 2:16 pm

Hello,

Could you please send a little example solution using a sample application in order to show me you issue?
I am not exactly sure what you are trying to do with the select box.
Thank you!

Regards,
Bernhard

generalecaster
Posts: 20
Joined: Thu May 09, 2013 10:44 am

Re: On change select troubles

Post by generalecaster » Thu Aug 08, 2013 2:55 pm

Hi,

we have a lot of select box that must execute code when their value changes.
The only thing I'mtrying to do is activate the onChange event on them.

Now I've fixed the problem setting the previous element in the list and then making a KeySequence ({Down}) on my select box.

Thanx for answer
Max

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: On change select troubles

Post by Support Team » Fri Aug 09, 2013 1:32 pm

Hello Max,

Thank you for the information.
I am glad that you could find a workaround.

Regards,
Bernhard