| || |
New to CodeUI with VS2012 - error using mutiple UIMaps
I'm starting to look into Coded UI in VS2012. Let's just say I'm not a fan of the way the tool generates its code. Because of that I'm looking into using the multiple UIMap approach and separating out my test methods and objects from the Desingner.cs file. (BTW, does anybody else who has used other tools think the people who created this model in Coded UI were on some serious drugs?)
Trying to follow some of the posts on how to do this I've created a main Testscript file (MTest.cs) and two UIMaps in a folder called MTest_UIMaps. The first UIMap file was created with the original test script (captured objects and methods). This file was copied to the folder and renamed (UIMap_Browser). Its objects and methods were copied out of UIMap_Browser.Designer.cs file and into the UIMap_Browser.cs file in the partial class. The UIMap itself was then cleaned out (nothing left in it, and the Designer file is just a shell). This all works fine in the main script.
My second UIMap file (with methods and objects) was added into the folder, created via Add/New Item/Coded UI Test Map in the IDE. The same type of rearrangement of code (objects & methods) was done after building it up.
Now here is my problem. When I try to reference/call one of my methods from the second UIMap file in the main test script [this.UIMap.LoginUserIDPage();] I get the following error message:
Error 1 'MTest_AutomationPOC.UIMap' does not contain a definition for 'LoginUserIDPage' and no extension method 'LoginUserIDPage' accepting a first argument of type MTest_AutomationPOC.UIMap' could be found (are you missing a using directive or an assembly reference?) C:\VS2012_Projects\MTest_AutomationPOC\MTest_Autom ationPOC\MTest.cs 36 24 MTest_AutomationPOC
And I've done some digging on the error message but because of my lack of experience with C# I'm not sure how to decipher things. Also, I've gone back over some of the documentation I have regarding using multiple UIMaps and am getting confused with talk (and code samples) for the TestRunner/TestRunUtility class setup.
So, any of you Coded UI guru's got an idea of how to fix the error code and point me to some detailed information (with decent screenshots) on using multiple UIMaps and splitting out methods/code/objects for them.
Thanks in advance for any help and/or advice on this. ;-)
CodedUI approach is different from other tools. Many enhancements are added in VS 2013.
Anyway you can try following links.
Tutorial ? How to create a Coded UI Test - Mathew Aniyan's Blog - Site Home - MSDN Blogs
CUITe (Coded UI Test enhanced) Framework - Home - This framework will help you to avoid all UIMap related Issues. YOu can create a class similar to window declarations in Silktest.
You could do worse than browsing the whole of Mathew Aniyan's CodedUI references: Content Index for Coded UI Test - Mathew Aniyan's Blog - Site Home - MSDN Blogs
In amongst them is Walkthrough: Using multiple Coded UI maps in test automation - Musings on software development - Site Home - MSDN Blogs - which isn't particularly well screenshotted, but there's a lot of extra information in the comments. Almost all the 2010 information works for 2012.
I have to agree with Jim. I am also new to using the tool and find it confusing to navigate. I am one of those that have been using RFT. thanks for the link to various tutorial and will explore those links before bugging you folks for answer to my many other questions
You're better off at least only using the UI map files for the GUI mapping and hand coding against them, or totally hand coding from scratch. Record playback style automation has moved on but is still rather weak for large scale automation.
Coded UI generates tests in a way that MS does NOT recommend coders to work -that says a lot about it. Not easy to read and actions, ui mappings and assertions also all in one file. Other than testing very small or basic apps, I recommend avoiding this approach. Hand coding from scratch does have a steep learning curve especially for non-web apps hence a half-way approach might be more suitable to some. If you can withstand the steep learning curve and slow progress hand coding everything is the way forward in my opinion.
Last edited by DSM; 07-03-2015 at 12:52 PM.