locked
Automation test in CodedUI with test Builder RRS feed

  • Question

  • Hi,

    In CodedUI test,using codedUI test Builder I can record the application & generate code,Rebuild solution & then Run the tests.Test Explorer indicate the status.Then I save the file.After that what to do?What is the next step of automation.Plz guide me.

    • Moved by Tina-Shi Thursday, February 5, 2015 6:56 AM the issue is related to the coded UI test
    Tuesday, February 3, 2015 7:52 PM

All replies

  • Hi Nazimanasir,

    According to your description, I know that when we record and playback a coded UI test with VS IDE, it is an automated test.

    >>After that what to do?What is the next step of automation.

    In addition, from the pervious thread discussion, could you please tell me if you want to automate the coded UI test with MTM?

    If yes, I suggest you can refer the following thread and then automate the coded UI test with MTM.

    Reference:

    https://social.msdn.microsoft.com/Forums/en-US/c02ae9bf-692b-4eda-b9da-988e2464dae3/using-mtm-2013-how-to-configure-the-coded-ui-ordered-test-with-mtm-2013-and-how-to-execute-from?forum=vsmantest

    If no, I suggest you can provide me more detail message about your issue and then I will follow up the issue.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, February 4, 2015 8:57 AM
  • Hi,

    Thankyou for your answer.

    We are going to automate test without LabCenter.Still not finalize whether to use Lab Center or not.

    My Question is:

    I Created a new CodedUI project,& add codedUI test & record the application,rebuild the solution & run the test.In Test results Window,it  always shows test run Failed.This record & run is not automation in CodedUI right.Then,how can I  automate the test. I opened the sln file of codedUI project & run .cs file  & it runs the application what I captured already & indicate the status.How can I find defects & validate the application.

    When it will indicate Failed status:- Whether inappropriate recording of application or functionality fails.

    Wednesday, February 4, 2015 10:07 PM
  • Hi Nazimanasir,

    Sorry for my misunderstanding your issue.

    >>In Test results Window,it  always shows test run Failed.

    Could you please share me the detail error message in the test result windows from the Test Explorer?

    In addition, I suggest you can try the following MSDN document to re-create a simple coded UI test check this issue.

    Reference:

    https://msdn.microsoft.com/en-us/library/dd286726.aspx

    If you have any new message about this issue, pleased tell me.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 5, 2015 6:55 AM
  • Hi,

    In Test Results Window,I received error message as (Failed -Test method NetOneNet.CodedUITest1.CodedUITestMethod1 threw exception:...)

    My application has no textboxes & buttons & other controls which has properties. My application is purely a map & routes of places(like google maps).So for these application,whether can I automate using CodedUI.

    If so,how can I create CUITe framework.

    Thursday, February 5, 2015 7:08 PM
  • Hi Nazimanasir,

    Glad to receive your reply.

    >>My application is purely a map & routes of places(like google maps).So for these application,whether can I automate using CodedUI.

    Generally, I know that the coded UI test is used to record and verify the UI control correctly like the button, textbox, etc.

    As you said that you want to use the coded UI test to record the map & routes of places, I tried to do it. I found that I could not record or verify the routes of places for in map application, so I think that it is not possible to automate your application using Coded UI test.

    If you want to know more information about the coded UI test, I suggest you can refer the link as I pervious provided link about Verifying Code by Using UI Automation.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 6, 2015 8:10 AM
  • You only show a small portion of the error message: "(Failed -Test method NetOneNet.CodedUITest1.CodedUITestMethod1 threw exception:...)". This suggests that the fault in within the code in your main test method, ie in "CodedUITestMethod1".

    There are two ways of executing a Coded UI test from Visual Studio, there is a "Run tests" command and also the "Debug tests" command. Use the "Debug tests" command. When the fault occurs test execution should pause and the debugger should show you the exact line of code. You can then use the full facilities of the Visual Studio debugger to investigate the problem.

    Regards

    Adrian

    Friday, February 6, 2015 9:07 AM
  • Hi,

    1.I entered the website address in address bar of google & I select site name from drop down,it shows error message.What are the other UI controls are verified in CodedUI apart from button,textbox.

    I recorded & run the gmail & google application in CodedUI.I received the error message like:
    Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException:Unable to find the top level element of the control.

    Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControl NotFoundException:Unable to find Windows Internet Explorer window with 'Google Maps-Internet Explorer' in the title-->

    Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControl.NotFoundException:The playback failed to find the control with the given search properties.Additional Details:TechnologyName:'MSAA' ControlType:'Window' Name:'Google Maps-Internet Explorer' ClassName:'IEFrame' -->

    System.Runtime.InteropServices.COMException:Error HRESULT E_FAIL has been returned from a call to a COM componenet.





    • Edited by Nazimanasir Friday, February 6, 2015 9:17 PM
    Friday, February 6, 2015 8:19 PM
  • Hi,

    Thankyou for your reply.

    Still I am in confusion,Let me describe about my application in detail.It's like Paint application in which left hand side is the toolbar contains buttons & dropdrown & select buttons.Right hand side is the items pane in which I do editing (eg: click fiber button & place hubsite  in item pane area& click the cable button from the toolbar & connect the hubsites,(routes) in the itempane).So in my application partially buttons & routes of areas where fiber cable is provided.It's similar to autocad,Paint application.

    And plz let me know whether can I automate this in CodedUI.? 

    Friday, February 6, 2015 8:45 PM
  • Hi Nazimanasir,

    Sorry for my delay.

    From the error exception message as you provided, it seems that you could not find the google browser window by the searchproperties when you are playbacking the coded UI test.

    First, I suggest you can try to check if the google map windows action be recorded using the coded UI test builder in the UIMap.uitest file.

    Second, I suggest you can try to use the DrawHighlight Method to check if the google map windows control is found before you perform actions on the control.

    You can also try to add more searchproperties for the google map windows control check this issue.

    In addition, please refer the following blog to check this issue for coded UI test.

    http://blogs.msdn.com/b/balagans/archive/2009/12/28/9941582.aspx

    http://blogs.msdn.com/b/tapas_sahoos_blog/archive/2011/11/07/troubleshooting-record-and-playback-issues-in-coded-ui-test.aspx

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 9, 2015 8:14 AM
  • Hi,

    Thankyou for your reply.

    Still I am in confusion,Let me describe about my application in detail.It's like Paint application in which left hand side is the toolbar contains buttons & dropdrown & select buttons.Right hand side is the items pane in which I do editing (eg: click fiber button & place hubsite  in item pane area& click the cable button from the toolbar & connect the hubsites,(routes) in the itempane).So in my application partially buttons & routes of areas where fiber cable is provided.It's similar to autocad,Paint application.

    And plz let me know whether can I automate this in CodedUI.? 

    I checked in UIMapDesigner everything was recorded from my application.

    Still I Got the below error message

    Test method TestProject8.CodedUITest2.CodedUITestMethod1 threw exception:
    Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
    TechnologyName:  'UIA'
    ControlType:  'Window'
    Name:  'Attributes'
    ClassName:  'HwndWrapper'
     ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.

    Where to find & how to use the DrawHighLight() Method ?

    Monday, February 9, 2015 10:14 PM
  • Hi Nazimanasir,

    As you said the Paint application, could you please share a screen shot about your UI action you record for the Paint application?

    >>Test method TestProject8.CodedUITest2.CodedUITestMethod1 threw exception:
    Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:

    Based on the exception error, I know that  when the SearchProperties of the control are not good enough or the serach condition for the control is changed automatically, it will generate this issue.

    Paul gave us some suggestion about how to handle this issue, if possible, please refer:

    The playback failed to find the control with the given search properties. Additional Details:

    Error running the Coded UI test

    In addition, as you said how to use the DrawHighLight() Method, I suggest you can refer the blog about Troubleshooting Record and Playback issues in Coded UI Test as I pervious provided by handing code to add the DrawHighLight() Method.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, February 10, 2015 11:03 AM
  • As you asked,herewith I have attached my application screenshot.When I click the Ok,Select & icon(Inside Plant) button,I received the error messages(The playback failed to find the control with the given search properties).So I tried to insert the statement like this:control.SearchProperties.Add(new PropertyExpression("InnerText", "OK", PropertyExpressionOperator.Contains));Even the error exists.Whether VS 2010 Feature Pack 2 supports this application for automatically add the property of UImap control by using CodedUI test editor?Where can I download it?Is it needs subscription?

    Tuesday, February 10, 2015 10:36 PM
  • Hi Nazimanasir,

    Glad to receive your reply.

    >>As you asked,herewith I have attached my application screenshot.

    Where did you share the screen shot there? I did not see the screen shot, so please share me the screen shot again.

    In addition, I suggest you could try to playback the Windows control action again after you ensure the recording web page be opened in the URL.

    If you create the coded UI test using VS2010, you can also try to install the VS2012 SP1 and then check your issue.

    http://www.microsoft.com/en-hk/download/details.aspx?id=23691

    Since I am not reproduce your issue, if the coded UI test still could not work. If possible, I suggest you can provide me your Paint application and your coded UI test project so that we will further help you solve this issue. You can upload the Paint application and coded UI test project to OneDrive and then copy link here.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Tina-Shi Tuesday, February 17, 2015 3:11 AM
    Wednesday, February 11, 2015 9:53 AM
  • Hi Nazimanasir,

    Could you please tell us what about this problem now?

    If you have been solved the issue, would you mind sharing us the solution here? So it would be helpful for other members who get the same issue.

    If not, please let us know the latest information about it.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 13, 2015 7:39 AM