Intermittent failures with "Set Value of HTML Element"

153 views
Skip to first unread message

Chris Burgess

unread,
May 23, 2012, 8:35:20 PM5/23/12
to Fake
I'm using a purchase workflow to test a payment gateway; probably
about 25 actions (some populate many fields, eg "Set Value of:
input.form-text to 'Lorem Ipsum'").

Maybe one in three runs fails due to a Set Value action not being able
to find the required element in the DOM, even though I've verified
both through Inspect Element and using jQuery in the page which has
failed that there is only one element of that ID.

Sometimes adding delays seems to help reduce the frequency of it
happening.

Is this a known issue? I can share a short video demo with the
developers if it will help.

Todd Ditchendorf

unread,
May 24, 2012, 12:04:36 PM5/24/12
to fak...@googlegroups.com
Hi Chris,

Hm, I have not experienced this, and have not heard any other reports of it, so I suspect this webpage is just probably just tricky.

You can try adding a "Wait for Condition" Action before any "Set Value of Element" Action which is giving you trouble.

Set the condition to "has element with id" or whatever specifier you are using. might help

TD

Gwizz

unread,
May 25, 2012, 11:15:00 AM5/25/12
to Fake
Hi Chris,

I had some events that looked like what you are describing. In my case
the page did not fully load and since load times will vary (and can a
page can be half loaded) it is possible to have a statement fail
seemingly mid-way and or seemingly random. I was puzzled at first to
see a fail of a statement that was obviously not incorrect. What Todd
describes will help in that case (he usually is right :-). You could
opt to test for an element that loads at the end of the page. Than you
are sure that the whole page is loaded before you start filling the
fields, in that case you only have to do one test instead of several
tests for each statement that gives you trouble.

Hope it helps!

@Todd,

I wonder how a "load a page" is handled in Fake. It does seem to wait
until the browser gets a response. But does that imply that it waits
until the whole page is finished? And in my case (and perhaps Chris'
too), I guess there is a lot of content that is loaded after the
primary page is done . Say with Ajax or something similar. Could that
be the case why Fake proceeded with the next statement before a page
is fully loaded?

Todd Ditchendorf

unread,
May 25, 2012, 11:36:08 AM5/25/12
to fak...@googlegroups.com
Yes, Fake waits until the page is "done loading" after any page load starts. The problem is that JavaScript can execute any arbitrary actions after page load is complete. These actions may appear to the user as if they are part of the "page load" although they really are not.

In these cases, using the "Wait for Condition" Action solves the problem.

TD

Brad Spry

unread,
Jul 25, 2013, 1:22:14 AM7/25/13
to fak...@googlegroups.com
Finally got the element targeted by evaluating an xpath expression.  Browser tools for xpath identification leave everything to be desired.  Hand coding it was the way to go.

Apparently, Fake sees the xpath expression evaluate true seconds before it is painted to the screen.  What I mean is, it evaluates faster than the screen visibly changes.

Is there anything I can tune to have "Wait for Condition" wait for seeing the change display on the screen?

FYI - I'm writing tests for YUI dynamically generated pages.


B
Reply all
Reply to author
Forward
0 new messages