UI Testing in VSTS 2010

    General discussion

  • Hi All,

    I would like to start a discussion on using UI tests in VSTS. Any information that can help testers understand and create better UI tests using VSTS 2010 UI tests feature would be greatly appreciated.
    To start with if anyone can give a walkthrough on the various components of the UI test.

    Wednesday, December 09, 2009 2:01 PM

All replies

  • A quick (but bit old) video of the feature is at - http://channel9.msdn.com/shows/10-4/10-4-Episode-18-Functional-UI-Testing/

    Mathew has some useful blogs at http://blogs.msdn.com/mathew_aniyan/

    Apart from these, if you use this Bing search, you will find lot more - http://www.bing.com/search?q=%22coded+UI+test%22&form=QBRE&qs=n

    Thanks, Gautam http://blogs.msdn.com/gautamg
    Wednesday, December 09, 2009 2:21 PM
  • Thanks Gautam for such a quick response. I am going through the blogs and they are indeed helpful.
    Would appreciate any insites on the various components(eg. the .cs files) generated after recording and the various autogenerated classes, methods etc.
    One more thing, how can we extract some text/value from the web page and save it for further use in the tests. eg. There is a text "Hello" on the web page and I want to save it to reuse.

    Thanks again for your inputs.
    PS: "Hand-coding a Coded UI Test" by Mathew helpful. Looking for something more on the same lines :)
    Wednesday, December 09, 2009 2:38 PM
  • At this time we are little short on documentation.  Many folks are blogging and I would suggest searching a bit through various blogs for your requirement.

    Thursday, December 10, 2009 7:09 AM
  • Thanks alot Gautam.
    Any pointers on how I can retrieve some text dynamically from a web page for further use in my Coded UI Tests?
    Can we use the DOM approach by any chance?

    Thursday, December 10, 2009 10:53 AM
  • Pankaj - you could just point to the control whose text you want to fetch and extract that property. Look at the CUIT builder's assert page for an idea of what control has which props
    Friday, December 11, 2009 8:44 AM
  • Thanks Anu.

    I am not sure whether I got your point or not but that way I can get the value while recording (by putting some assertion) and then its reflected in the code but it is then an hardcoded value. I need to extract the value on run time. I want that the value gets stored in some variable while my test is executing. In my case there is some text on the page that is dynamic. I need to fetch that text string from the web page on the run time and use that value later on in my test.

    Friday, December 11, 2009 11:08 AM
  • Hi Pankaj
    You can use the GetProperty method to get the properties if they are dynamically changing

    UITestControl.GetProperty("Value") will give you the value on the UitestControl at any point.

    Friday, December 11, 2009 11:44 AM
  • Thanks Rituparna.

    That will definitely help in my case. I am trying to figure out how I can store this value and use it later in other test script. I need to pass on the retrieved values to other tests. I need to understand the structure of the Coded UI tests and its flow. Its a bit tedius to identify the controls as the tool generates a lot of code for every single control.

    Thanks for everyone's inputs. I will keep on seeking help from you guys :-)

    Friday, December 11, 2009 5:17 PM
  • Hi Friends,

    I again need your inputs. I am having one small test where in I need to login with some username and password. I want to make this as a general purpose method that can be re-used. I created a method that takes username and password as arguments. But my problem lies in the fact that the coded UI test accepts some encrypted (encoded)  string instead of  the actual string that i pass as a password. This string is generated while recording. Any pointers on how I can generate this encrypted string from my actual password string.
    Only way out for me at present is to record  my login sequence with the new password that i want to use and then use the generated encrypted value but that obviously is not a good way.

    Monday, December 14, 2009 5:26 PM
  • Hi,

    Please create new thread for new issue.  It makes tracking the question easier on our side and you will get faster response back.

    For your issue, check http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/72dbc0bc-8284-467b-8d49-6f858b56e6f6

    Wednesday, December 16, 2009 6:49 AM
  • Thanks Gautam!
    And sorry for posting it in the same thread.

    Wednesday, December 16, 2009 1:23 PM
  • very helpful info..

    Also try this:

    http://blogs.msdn.com/b/mathew_aniyan/archive/2010/02/11/content-index-for-coded-ui-test.aspx and http://blogs.msdn.com/b/gautamg/archive/2010/02/19/useful-set-of-utility-functions-for-coded-ui-test.aspx



    Wednesday, July 14, 2010 4:16 AM
  • I hate to bring up an old topic, I posted this question here , How Can I change the credentials of the browser, The Web app using the AD group. Is there any way to inject the username and password.
    Tuesday, July 27, 2010 7:27 PM