locked
Interaction between jquery and coded ui test RRS feed

  • Question

  • Hi,

    We recently upgraded the version of the jquery libraries that we are using in our web development project from a 1.X.X version to 2.0.2.

    Our web application implements an AJAX call to populate data in a grid based on a selection of an item in a drop down.  The dropdown is opened, an item in a list is selected and then the drop down closes.  On close, a .getJSON call is made which brings back information to populate the grid.

    When we run automation tests, using coded ui test to operate on the dropdown control and populate the grid, the AJAX call goes out but never returns.  Our application sits in a loading status but the grid never loads.

    If we run the same process manually (without coded ui interaction) the grid is populated.

    There seems to be an interaction problem between coded ui test and jquery 2.0.2 where the AJAX call and process start but never return anything.

    Has anyone seen and interaction like this before?  Any ideas on how to fix it?

    We are running test in IE9.  Let me know if you need any other information.

    Thanks

    Jeff

    Wednesday, June 26, 2013 6:53 PM

Answers

  • Amanda,

    Thanks for the reply.  It turns out that there is some sort of bad interaction between jquery 2.0.2  and CUIT.  We are using the method call getJSON to retrieve information as part of an AJAX call.  The application is making the getJSON call but nothing ever returns meaning that we didn't even get a fail message back from the call.  It goes off into the ether, never to return.

    We reverted to jquery version 1.9 and this fixed the problem.

    Thanks

    Jeff

    • Marked as answer by Amanda Zhu Monday, July 1, 2013 2:19 AM
    Friday, June 28, 2013 4:19 PM

All replies

  • Hello,

    Thank you for your post.

    I suggest that you can try the same scenario on another machine to check if you can get the same issue.

    If so, as my personal point of view, maybe it is an issue between Coded UI Test and jquery 2.0.2. As my personal point of view, maybe the population action for a grid in jquery 2.0.2 is not supported by Coded UI Test. I am not jquery expert. In this case I suggest you can consult on jquery support: http://jqueryui.com/support/ for better support.

    If no, I am afraid the issue is related to test environment.

    Thank you for your post.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, June 27, 2013 7:55 AM
  • Amanda,

    Thanks for the reply.  It turns out that there is some sort of bad interaction between jquery 2.0.2  and CUIT.  We are using the method call getJSON to retrieve information as part of an AJAX call.  The application is making the getJSON call but nothing ever returns meaning that we didn't even get a fail message back from the call.  It goes off into the ether, never to return.

    We reverted to jquery version 1.9 and this fixed the problem.

    Thanks

    Jeff

    • Marked as answer by Amanda Zhu Monday, July 1, 2013 2:19 AM
    Friday, June 28, 2013 4:19 PM
  • Hello,

    Glad to see this issue has been resolved and thank you for sharing your solutions & experience here. It will be very beneficial for other community members who have similar questions.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, July 1, 2013 2:19 AM
  • Sorry, Amanda, but we still can't use jquery 2.0.2 with Coded UI Tests and you are glad about all our downgrading.... The problem is everywhere on specific forums and it's still no answer from Microsoft in more then two months......

    Friday, August 23, 2013 11:52 AM
  • Hello,

    As I mentioned, maybe the population action in jquery 2.0.2 is not supported by Coded UI Test. And I suggest you can consult on jquery support: http://jqueryui.com/support/ for better support.

    Thanks,


    Amanda Zhu <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Amanda Zhu Monday, August 26, 2013 5:39 AM edit
    Monday, August 26, 2013 5:36 AM
  • I'm suffering from the same issue - I upgraded to jQuery 2.0.3 and all ajax requests made within Coded UI tests stopped working. The ajax request goes back to the server, but our callback is never called. The same calls work fine when using the site manually.

    I did a bit of digging and discovered that Coded UI injects some javascript into every page, which shims the XMLHttpRequest object. So that when other javascript tries to create an XMLHttpRequest to make an ajax call, it gets the shim rather than a real XMLHttpRequest.

    The shim only handles callbacks attached to the onreadystatechange event, which was fine for jQuery 1.9, but jQuery 2.0+ attaches its callbacks to the newer onload and onerror events.

    The end result is that the ajax call will be made, but your completion callback will never be called.


    • Edited by Ross McNab Monday, January 27, 2014 12:56 PM
    Monday, January 27, 2014 12:32 PM
  • We've discovered a workaround, which disables the Coded UI shims:

    http://stackoverflow.com/questions/17849074/jquery-ajax-success-not-getting-triggered-with-coded-ui-test-project/21381319

    Monday, January 27, 2014 12:55 PM
  • Is there any improvement from CUIT in VS 2013 ?

    Friday, February 27, 2015 11:58 AM