How to perform own assertions with coded UI testing
I'm working with the visual studio 2010 codedUI tests.
I want to be able to perform a little mo开发者_JAVA百科re than i can at the moment.
e.g. I can can Assert if a particular field "AreEqual" to or "Contains" etc, but i want to do more.
eg, i want to check if the field contains a numerical value within it. I edited the UIMap.Designer.cs and was able to achieve what i wanted.
The only problem is is that this file gets overwritten when new test are added.
so my question is how can i "fiddle" with fields/stings in the UI and implement my own assertions on them?
Thanks
Use the partial class created (UIMap.cs) to add your custom code. This file doesn't get blown away and has full access to the internals of the UIMap (since it's part of it).
You can get it done dude, but be careful by keeping back up.
Open uitest
file :
- Go to test marker node that contains the relevant assertion,
- Delete the method.
- Save and find the stuff you expect
Its beeen working great for me but one two occasions I was dumbfound to face many issues with my acriipt running. So have back up and test this out.
I was told that the solution in "Coded UI" was to create your own libraries and then twitch your new test cases accordingly.
Haven't tried it, though.
精彩评论