Forum Discussion
CBleunven
12 years agoContributor
Hi Maxime,
Sorry for my late come back, I didn't pay attention that Object on a Page doesn't have the OnFocus property (I work on an application).
It's quite difficult to find some properties with specific values when the object is focused, because, when you open the Object Spy, the Object of interest lost the focus...
So you need in your script to capture the value of the different properties.
A workaround is possible if you have at the beginning of the test, a list of the different elements you will meet. You may previously add a method to the onfocus event of each element.
var theFocusedElement;
MyElementA["onFocus"] = function() {
Log["Message"]("Element A receives focus.");
theFocusedElement = MyElementA;
}
MyElementB["onFocus"] = function() {
Log["Message"]("Element B receives focus.");
theFocusedElement = MyElementB;
}
etc...
The "problem" is that you modify your element under test...
regards,
Christophe
Sorry for my late come back, I didn't pay attention that Object on a Page doesn't have the OnFocus property (I work on an application).
It's quite difficult to find some properties with specific values when the object is focused, because, when you open the Object Spy, the Object of interest lost the focus...
So you need in your script to capture the value of the different properties.
A workaround is possible if you have at the beginning of the test, a list of the different elements you will meet. You may previously add a method to the onfocus event of each element.
var theFocusedElement;
MyElementA["onFocus"] = function() {
Log["Message"]("Element A receives focus.");
theFocusedElement = MyElementA;
}
MyElementB["onFocus"] = function() {
Log["Message"]("Element B receives focus.");
theFocusedElement = MyElementB;
}
etc...
The "problem" is that you modify your element under test...
regards,
Christophe
Related Content
- 12 years ago
Recent Discussions
- 4 days ago
- 4 days ago