Triggering onblur

Class library usage, coding and language questions.
User avatar
Nicklas
Posts: 20
Joined: Mon Sep 26, 2011 2:53 pm
Location: Sweden

Triggering onblur

Post by Nicklas » Tue Jan 31, 2012 4:48 pm

On our web page we have an input field where users enters their email address. If they enter an invalid one a small icon will appear, and if they enter a valid another icon will show instead. The icon appears once the field loses focus. Here's the problem:

After Ranorex have entered an email address to the field I'm unable to trigger the onblur event. I've tried clicking on a another element on the page and I've also tried to use .Focus() on another element, but no luck. Apparently we're using jQuerys .focusout() (which should even detect .PerformClick(), right?) on the element. Does anyone have any idea why it's not working?

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Triggering onblur

Post by Ciege » Tue Jan 31, 2012 8:14 pm

How are you having Ranorex enter text into the fields?
Are you using keyboard.press or just setting the value of the text boxes?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Nicklas
Posts: 20
Joined: Mon Sep 26, 2011 2:53 pm
Location: Sweden

Re: Triggering onblur

Post by Nicklas » Tue Jan 31, 2012 9:20 pm

I'm just setting the value ...emailField.Value = myEmail

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Triggering onblur

Post by Ciege » Tue Jan 31, 2012 9:47 pm

In that case you need to call the event yourself.

An easier method would be to have Ranorex click the textbox, then use keyboard.press to enter the text (which lets the textbox know that text is being entered) which will then trigger the event that you expect.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Nicklas
Posts: 20
Joined: Mon Sep 26, 2011 2:53 pm
Location: Sweden

Re: Triggering onblur

Post by Nicklas » Wed Feb 01, 2012 8:18 am

Ok great! Thanks for the input. One question though, what do you mean by "call the event yourself"? Can I trigger the .focusout() event manually?

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Triggering onblur

Post by Ciege » Wed Feb 01, 2012 3:18 pm

Depending on how your AUT is implemented you should be able to speak to one of your developers for how to trigger the event manually. You will need to know the proper method to call that they have implemented and what/if any parameters are needed in the call.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...