Click here to Skip to main content
15,886,781 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey guys im currently running tests on web applications, and i have noticed that when ever i tell VS to click on a text box field and type in some text, the test fails, but if i pre enter the text and just use the CUI test to click the button it does not fail and test is successful, why is this?

error im getting is pretty long from the results
error message:
CSS
Test method TestProject1.CodedUITest8.CodedUITestMethod1 threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotAvailableException: The control is not available or not valid. Additional Details:
TechnologyName:  'MSAA'
Name:  'MIKES TRAVEL SHOP'
ControlType:  'Edit'
 ---> Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotAvailableException: The control is not available or not valid. ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.


do i have to rename the text box?, if so then how is this done, as when i try and open the UIMap.uitest file it is in XML.

any help is very much appreciated :)

Matt.
Posted

1 solution

Hello.

If you have not fixed this yet.

For me, i fixed this problem by adding an association from a label with text to the control.

It seems that the name for the control is found by using the text, and not the name itself.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900