locked
How Can I Force a Parameter Not Set During an Action Recording?

    Question

  • I wish to data drive a coded ui script from the test case in MTM, but one parameter will not map.  Is there a way to force this mapping?  I've tried recording several times without luck.

    More information:  The object that will not map to a parameter is a link in a table.  I can create asserts for this object, but just cannot get the parameter in the manual test case to "take" while capturing an action recording.

    Any help would be appreciated!

    Monday, April 11, 2011 6:11 PM

Answers

  • If you looked at the title to the original post...yes, it does.

    There is no "parameter" for hyperlinks (which is basically just a URL, which doesn't have parameters) unless you create one.

    Tuesday, April 19, 2011 10:37 PM
  • Data sources in Coded UI Test can only be one of three types: .CSV, XML, or a SQL database and have to be deployed to the test project. The connection string has to be linked to the test method. When I go back and read your original post, you use "coded ui test" but then you reference a manual test case. Are you working from an action recording (VS 2008) or an actual Coded UI Test (VS 2010 Ultimate)?  If from an MTM action recording, I apologize for wasting your time as I haven't used that particular tool.

    Thursday, April 21, 2011 6:56 PM

All replies

  • Does anyone have any helpful tidbits?  This seems like a bug where links cannot be parametrized.  Thoughts?
    Tuesday, April 19, 2011 2:40 PM
  • http://social.msdn.microsoft.com/Forums/en-AU/vsautotest/thread/4631d0c4-aef6-4ec1-97aa-fbce9384ae5a

    In order to parameterize a hyperlink for data-driven testing, you have to instantiate a new HtmlHyperlink. In other words, create a new control in your UIMap.cs (or .vb) file. Check the code in the last post, it's done correctly and should be a good guide for you.

    • Proposed as answer by Starting0ver Tuesday, April 19, 2011 4:46 PM
    • Unproposed as answer by I Have a Name Tuesday, April 19, 2011 8:52 PM
    • Proposed as answer by Starting0ver Tuesday, April 19, 2011 10:37 PM
    • Unproposed as answer by I Have a Name Thursday, April 21, 2011 10:05 PM
    Tuesday, April 19, 2011 4:46 PM
  • Thank you for your response, but maybe I do not understand.

    Yes, my test is data driven but the data is coming from a test case in Microsoft Test Manager.  I am pulling an action recording which stubbornly would not map one parameter.  So that parameter, and thus the data, do not appear as part of the generated code.

    My question pertains either to how to make that parameter map in the action recording in MTM or how to work around this in a CodedUI test since it does not "see" a parameter to use.

    Does your answer cover this situation?

    Tuesday, April 19, 2011 8:49 PM
  • If you looked at the title to the original post...yes, it does.

    There is no "parameter" for hyperlinks (which is basically just a URL, which doesn't have parameters) unless you create one.

    Tuesday, April 19, 2011 10:37 PM
  • Wow, I am not sure what to say.

    My data source is the test case and since the parameter does not exist (like it might be if the data were in a CSV file), I do not have the option to make this parameter data-driven.  So even if I follow what you suggest so as to parametrize a hyperlink, I have no way of pulling data into that code because I have no data coming from the test case.

    What am I missing?

    Tuesday, April 19, 2011 10:52 PM
  • Data sources in Coded UI Test can only be one of three types: .CSV, XML, or a SQL database and have to be deployed to the test project. The connection string has to be linked to the test method. When I go back and read your original post, you use "coded ui test" but then you reference a manual test case. Are you working from an action recording (VS 2008) or an actual Coded UI Test (VS 2010 Ultimate)?  If from an MTM action recording, I apologize for wasting your time as I haven't used that particular tool.

    Thursday, April 21, 2011 6:56 PM
  • I apologize, too, as I do not believe I explained well.

    I created another post with, hopefully, better information:  http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/2decec67-c527-4f31-a0ae-7e1bebdca98e .

    Thank you very much for your response and time to help me!

    Thursday, April 21, 2011 10:05 PM