I’m submitting a form to my server via JavaScript in the view, in order to start a server-side job. The view detects that the job has finished by a JavaScript callback being called. The exact details of the JavaScript communication between server and client should be outside of the scope of this problem (I think), but let me know if you need more details. If it helps, I am using the Comet-like SignalR library, rather than standard Ajax.
Now, I want to test this view in Watin (2.1.0). How can I make Watin wait until the server-side job has finished processing? Should I perhaps update an attribute in the view when it detects the job has finished?
Depends how your js and html code looks. It’s not that simple. Try to use
WaitUntil...methods.Let’s say that after job has finished new div elements with id
fooappears. To wait for that use this code:But sometimes it’s not that simple. Let’s say, that after job has finished, the content of the table changes, ie. old rows are removed, and new rows appears. If so:
Anyhow, this is just some tips. It’s almost always a pain, so don’t show me your actual code 😉