This is a migrated thread and some comments may be shown as answers.

Need help waiting on class change in a target element

1 Answer 47 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 19 Dec 2013, 06:42 PM
I am doing a test of an ajax form that we have running, and one of the conditions it does is sets a buttons state using class based on some of the jquery.ui built-in classes.  Our form is running this very long running ajax routine (we are doing some complex file IO) is using signalr to send feedback back to the ui.  What I would like to do is check the state of a button html element on the screen, and wait while it has a specific class.  when that class disappears (the button becomes enabled) I would like to proceed.

Here is the buttons initial html:

<button class="jw-button-next ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-secondary ui-state-hover ui-state-disabled" role="button" aria-disabled="false" type="button">

notice 'ui-state-disabled' there, that is what I want to be waiting to disappear.

Any suggestions?

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 24 Dec 2013, 01:04 PM
Hi Robert,

Thank you for contacting us.

Here is an example where Test Studio is waiting for class to set to some specific value:

HtmlDiv div = ActiveBrowser.Find.ById<HtmlDiv>("id");
div.Wait.ForAttributes(20000, "Class=myClass");

Here is some useful articles:

HtmlWiatClass

Verify HTML Style

Let me know if this helps.

Regards,
Boyan Boev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Robert
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or