fireEvent/onblur IE11 problem

Class library usage, coding and language questions.
Posts: 2
Joined: Wed Aug 12, 2015 12:32 pm

fireEvent/onblur IE11 problem

Post by GeorgeK » Wed Aug 12, 2015 1:42 pm

We are using multiple input fields for data on heavily scripted webclient (multiple functions are processing input data).

Internet Explorer 11, Windows 7 64-bit, Ranorex

Entering input text through:

Code: Select all

inputIDtest.Element.SetAttributeValue("Value", "testvalue")
sets value correctly, but following code

Code: Select all

doesn't seem to actually fire onblur event - so the attached functions are not processing the value.

I have tested running simple javascript code (bookmarklet) on the same webpage:

Code: Select all

inputs.namedItem('inputIDtest').value = "testvalue"
onblur is fired correctly and value is processed by functions.

I am not sure if RaiseEvent is actually supposed to do what I am expecting it to do (same thing as fireEvent) - it doesn't actually fire event on simple code like:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
	<script type="text/javascript">
	function MoveOut() {
	document.getElementsByTagName('input').namedItem('inputIDtest').innerText = "ONBLUR FIRED";
	function MoveIn() {
	document.getElementsByTagName('input').namedItem('inputIDtest').innerText = "ONFOCUS FIRED";
<p>Test input:&nbsp;<input id="inputIDtest" type="text" onblur="MoveOut()" onfocus="MoveIn()"></p>
Am I missing something or doing it wrong? Or is there some other way to utilize fireEvent in Ranorex?

User avatar
Ranorex Guru
Ranorex Guru
Posts: 7072
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: fireEvent/onblur IE11 problem

Post by odklizec » Fri Aug 14, 2015 9:37 am


It seems you have the RaiseEvent right, so I don't know why it does not work? I tried it via spy (right click over Input element >> select RaiseEvent action). However, I was able to fire up the event via ExecuteScript over the parent iFrame...
ExecuteScript.png (95.4 KiB) Viewed 4707 times
So all you need to do is to add iframeResult to the repository and call the ExecuteScript from it using MoveOut() function, like this...

Code: Select all

Pavel Kudrys
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

Posts: 2
Joined: Wed Aug 12, 2015 12:32 pm

Re: fireEvent/onblur IE11 problem

Post by GeorgeK » Fri Aug 14, 2015 3:36 pm

Thank you, definitely an interesting option, though probably not optimal in our current situation. I'll use Mouse Left Click for now.

I did some tests with ExecuteScript - using modified example code I've posted above (loaded in iframe) - and ExecuteScript seems to always return 'undefined', regardless of actual return value used - for example executing function ReturnNumber() {return 8;}.

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

Re: fireEvent/onblur IE11 problem

Post by Support Team » Thu Aug 20, 2015 4:05 pm

Hi GeorgeK,

Thank you for reporting the issue concerning the return value.
I observed, even if the return value is “undefined” the function will be executed properly. Anyway, I’ve already informed our responsible development department about the problem and one of my colleagues will analyze it in more detail.
Thank you for your patience.


Markus (S)