Coded UI Test Automation : Functional Automation In VSTS2010

VSTS 2010 has the Coded Ui Feature that is going to be heavily impinging on the Website related Test automation project dependency on several of the highly costly tools such as QTP RFT et al in near future.
The Coded Ui feature shall be demonstrated hitherto because it has been successfully used by the team across location to automate around 1200 oddd Test Scenarios at a pretty brisk pace.
How to Initiate ?
The Test project is what we select for creating an automation project under the Test project Template using
the coding language as of our choice ranging from  C# to VB through VC++ depending on the resource expertise availability.

Now creation of a Test Project results in a specific folder hierarchy that intricacies will be dealt separately .
But the point of immediate concern will be the roadmap to the creation of the complete basic functional test Automation
which is nothing but a demo with some screenshots organised in a step by step manner so as to let a layman can  proceed with the Test Automation getting realised to a success. The same shall be addressed in my next couple of posts.

Coded UI Advantage ?
 
The very basic issue that my experience with QTP automation suggests is the dependency on the hierarchy that
guides the compelete object Recognitiion mechanism in the QTP. This is a very organised manner of recognising the
various objects according to their Control Ids along with the Object Hierarchy which we at a very basic level relate
something as 
Browser-> Page-> Object controls and bla bla bla....

This results in some of the constraints related to further changes in the application that might result in the future
object recognition of the same control with some added prefix controls. One issue that I came across in this context that I would definitely like to share across is the incorportaion of the frame within the page that results in further object recognition of the same very control having the erstwhile control id in the hierarchial order of

Browser-> Page-> Frame.  
This is where I guess the QTP object recognition has faltered to address to the business needs.
And this simple loophole causes tremendously to the overall run of the scripts in the builds availed.

 
Near future might just carve out a niche for the new tool Coded UI Test Automation from the hubs of Microsoft development team capitalising onto the Market share of the most of the other Functional Test Automation Tool.

Hierarchy of Code creation during record time by Coded UI Approach ?

We can definitely take a lot more than just one or two posts discussing the overall hierarchy followed by the VSTS tool at a macro level. While creating the Test Project  under the Predefined templates by selecting the Test Project we move into a new view of the complete solution that   gets generated in VSTS. Namely the Solution Explorer. However if the same is not available do kindly click the View tab and select the Solution Explorer. It gets automatically hooked up onto the left pane of the window.

  • Suppose the name of the project is CodedUIDemo, the same name comes up under the complete hierarchy of the Test Project.
  • Now just right click the project name and click Add a Coded UI test to the project.
  • Wait for sometime , have a Kitkat break and come back.
  • I said the above for those having their RAM lesser than 2 GB.
  • Jokes apart , something that can be figured up from here is a small  "User Interface" comes as  a pop-Up in the right corner at the bottom.
  • Do note that there is  red button in the left side of the small sleek UI .
  • That very button when clicked provides the start to the Record Feature of the Coded UI Test Automation predominantly for the Functional Testing.
  • Other than this button we have three more featured buttons with some exciting functionality , but lets prefer going slow.
  • Until the red button is clicked , nothing gets recorded, but once you click this very red button, every action starts recorded.
  • Lets not be worried about every action getting recorded as it is pretty headache creating stuff.
  • Are you imagining the scenario like you are in the middle of doing some recording and the Chat window popping up and you getting excited your friend's chat interests more than the record you are in the middle of.
  • But take a chill - pill and do click the same button you had clicked to start recording which is currently displayed not as a red button but as a ..........
  • As a Window Media Player's "PAUSE" Button.
  • Just click the pause button and reply to the friend's chat message instantly congratulating him for his marriage getting fixed up with the lady he loves....
  • Dudes my lady love is in from work ..Lets carry on with this Interaction again with the following Posts.

Till then Hum hain rahi pyaar k fir milenge chalte chalte....





10 comments:

  1. Yellow Font is not readable.

    ReplyDelete
  2. Sorry buddy, Background change has been made to the blog due to recent comments regarding the same. Hence the uissue occured. I hope it suits the reader now.Thanks for your valuable inputs. You can go through below link for more on Coded Ui Testing:
    http://csesupport.blogspot.com/p/automation-testing-using-coded-ui.html

    ReplyDelete
  3. Hey Viplav...Please provide your mail id..i have few queries to ask regarding VSTS coded UI test for web automation

    ReplyDelete
  4. my mail id is viplav15@gmail.com. I think if you can let me know your email id i could be able to add you to the VSTS group as well.

    ReplyDelete
  5. Hi Viplav..I have added your mail id..Pls accept the request. I have also sent my query on ur mail id...pls respond on that mail.
    ...Mahen

    ReplyDelete
  6. Hi Viplav,

    I want to run automated tests which are setup with VS2010 and the Test Manager based on Coded UI. Do you know if it's necessary to install a Test Controller on a different PC than to which the Test Agents are installed? I can't get it working with the Test Controller and Agent on the same PC.

    Thanks in advance.

    Roland Ulsamer.

    ReplyDelete
  7. yeah Roland it is possible. Different environment issue will come up in case TFS is being utlised and the coded ui test are stored on the server and you wish to run it remotely.

    ReplyDelete
  8. In my case TFS is being utilised on a separate server, but the Coded UI tests, the Test Agent and Test Controller are all installed on my PC. According to the examples in the helppages of VS2010, TFS and the Test Controller are installed on the same server. Do you think it is possible to run automated tests in this case?

    Greetings, Roland Ulsamer
    roland.ulsamer@gmail.com

    ReplyDelete
  9. Yeah it will work absolutely fine.
    I have worked without TFS as well as with TFS checked in codes projects.
    Something I would definitely like to know from your end is when you try running the ordered test, what error do you encounter?

    ReplyDelete
  10. Hi,
    I am trying to write automation test using coded UI for a web page in which clicking on import button opens a file dialog to select an excel file from local computer and after I click open the file should be processed and properly imported into our website.
    I am able to successfully record all the above mentioned actions but after I click open the file dialog closes as expected but the imported file progress animation is showing that file is being imported for long time, I waited for like more than 10 minutes but still no luck, but manually it is uploaded in less than a second.
    Is there anything I need to be specific while recording these kind of actions.
    I also followed msdn forum about it
    http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/9f70028b-9c24-4d17-bb62-7466706699c0
    I also tried writing codedUI test to compose a new email in gmail and attach any file from my local computer but facing the same issue, I am able to select the file and everything but the upload is just not processing. I looked for solution in all blogs and msdn tutorials from 2 days but no luck I really need help with this. Please reply me back. I am using Visual Studio 2012 Premiuim
    Thanks in advance.

    Best Regards,
    Raji

    ReplyDelete