Asked by:
Technology identidied as MSAA in web application

Question
-
Hi,
I have written script in coded UI for an web application. The code checks for an control (HTML PANE) after doing some operations. the same script willl execute 2 times as designed in for loop code works fine and identifies the control in first loop but I am getting below error when it is executing second loop.
Test Name: TempTestMethod
Test Outcome: Failed
Result Message:
Test method NutriGen_Creation.CodedUITest1.TempTestMethod threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotAvailableException: The control is not available or not valid. Additional Details:
TechnologyName: 'MSAA'
ControlType: 'Custom'
---> Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
TechnologyName: 'Web'
Id: 'ctl00_main_lblVendorItemID'
ClassName: 'HtmlPane'
ControlType: 'Pane'
TagName: 'SPAN'
---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
I am not sure, why the code behaves different second time while it is working fine for first time in for loop. Anyone can throw some light on this?
Thanks,
Suresh L
Tuesday, March 21, 2017 8:44 PM
All replies
-
Hi Suresh L,
This issue could be caused by the search properties changing after the first loop, as I could see there are five search properties. Please make sure all of them won't change each loop.
If you could find out the certain property changes very time, but others don't, you can remove this search property in UIMap.
I suggest you could add Drawhighlight() method in your loop, then you could see if the control can be identified very time.
Best regards,
Fletch
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- Edited by Fletch Zhou Wednesday, March 22, 2017 9:01 AM
Wednesday, March 22, 2017 5:38 AM -
Hi Fletch,
Thanks for your reply.
The Control is not added in UIMap. I am identifying them by hand Coding through above said five search properties.
In second loop, I have inspected through Code Editor manually and confirmed that these five properties are not getting changed.But while executing , am getting same above said error and it couldnot identify the control.
Even I used DrawHighlight Method(), it identified the control for first time and it couldnot identify the control in second loop
Wednesday, March 22, 2017 3:15 PM -
Hi friend,
Would you mind sharing your test code with us?
Best regards,
Fletch
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.Friday, March 24, 2017 1:43 AM