How can I solve this MSAA error?
Hello
I'm fairly new to Coded UI so please cut me some slack.
What I'm trying to do is just something very simple. Taking a screenshot of MS Excel.
Here are my steps to reproduce:
Pre-requisite: Have Excel 2010 Open
Steps:
Begin Recording
1. Hover your mouse to the top left corner and click the tiny down-arrow
2. Select "Print Preview and Print"
3. Go to File Menu
4. Click EXIT
Stop Recording
-------------------------------------------------------------------Code------------------------------------------------------------------------------
namespace excelscreenshot{ /// <summary> /// Summary description for CodedUITest1 /// </summary> [CodedUITest] public class CodedUITest1 { public CodedUITest1() { } [TestMethod] public void CodedUITestMethod1() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 this.UIMap.email(); //WinMenuItem uIPrintPreviewandPrintMenuItem = this.UIMicrosoftExcelBook1Window.UIItemWindow.UICustomizeToolbarClient.UICustomizeQuickAccessGroup.UIPrintPreviewandPrintMenuItem; Image pic = this.UIMap.UIMicrosoftExcelBook1Window.CaptureImage(); pic.Save(@"C:\Users\Diego Cortes\Desktop\derecho\foto.jpg"); //,System.Drawing.Imaging.ImageFormat.Jpeg); TestContext.AddResultFile(@"C:\Users\Diego Cortes\Desktop\derecho\foto.jpg"); } #region Additional test attributes // You can use the following additional attributes as you write your tests: ////Use TestInitialize to run code before running each test //[TestInitialize()] //public void MyTestInitialize() //{ // // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 //} ////Use TestCleanup to run code after each test has run //[TestCleanup()] //public void MyTestCleanup() //{ // // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 //} #endregion /// <summary> ///Gets or sets the test context which provides ///information about and functionality for the current test run. ///</summary> public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } } private TestContext testContextInstance; public UIMap UIMap { get { if ((this.map == null)) { this.map = new UIMap(); } return this.map; } } private UIMap map; }}
----------------------------------------------------------------------This is the Error--------------------------------------------------------
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotAvailableException was unhandled by user code
HResult=-268111872
Message=The control is not available or not valid. Additional Details:
TechnologyName: 'MSAA'
Name: 'Print Preview and Print'
ControlType: 'MenuItem'
Source=Microsoft.VisualStudio.TestTools.UITesting
BasicMessage=The control is not available or not valid.
StackTrace:
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.EnsureValid(Boolean waitForReady, Boolean refetch)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetPropertyValue(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetProperty(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetPropertyInternal[T](String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.get_BoundingRectangle()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.CaptureImage()
at excelscreenshot.CodedUITest1.CodedUITestMethod1() in C:\Users\Diego Cortes\Documents\Visual Studio 2010\Projects\excelscreenshot\excelscreenshot\CodedUITest1.cs:line 32
InnerException: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotAvailableException
HResult=-268111872
Message=The control is not available or not valid. Additional Details:
TechnologyName: 'MSAA'
ControlType: 'Window'
Source=Microsoft.VisualStudio.TestTools.UITesting
BasicMessage=The control is not available or not valid.
StackTrace:
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.EnsureValid(Boolean waitForReady, Boolean refetch)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.EnsureValid(Boolean waitForReady)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.EnsureValid()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.EnsureValid(Boolean waitForReady, Boolean refetch)
InnerException: System.Runtime.InteropServices.COMException
HResult=-2147467259
Message=Error HRESULT E_FAIL has been returned from a call to a COM component.
Source=Microsoft.VisualStudio.TestTools.UITest.Playback
ErrorCode=-2147467259
StackTrace:
at Microsoft.VisualStudio.TestTools.UITest.Playback.Engine.IRPFPlayback.FindAllScreenElements(IScreenElement pScreenElementStart, String bstrQueryId, Object&
pvarResKeys, Int32 cResKeys, Int32 nMaxDepth, Object[]& foundDescendants)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindTopLevelWindowHelper(String queryId)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindFromPartialQueryId(String queryId)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.EnsureValid(Boolean waitForReady, Boolean refetch)
InnerException:
THANKS
for your help
DIEGO
Hi DIEGO,
As far as I know, the coded UI test has a limitation for office client app controls.
Reference:
https://msdn.microsoft.com/en-us/library/dd380742(v=vs.120).aspx
Best Regards,
Jack
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.
Similar Messages
-
How can I solve this publishing error in iWeb?
Suddenly, when I try to publish in iWeb, I get the following error message:
Publish error:
Can't create the file "site/home.html." The disk may be damaged or full, or you must not have sufficient access privileges
Well, I have a Mac Pro tower, loaded with plenty of space and my disk definitely isn't damaged. Go Daddy (my host) first told me it might be a firewall problem and to contact my internet provider, which I did. But they told me there were no outgoing firewalls. So I went back to go Daddy, who reset all my permissions, but I still got the same iWeb message listed above when I tried to publish. Go Daddy was able upload my files at their end as a test, which means the problem is right here with my iWeb.
Anyone have any ideas?Try the troubleshooting steps under "FIx iWeb" here...
http://www.iwebformusicians.com/iWeb/iWeb-Tips.html -
HT201210 how can i solve this 1015 error
plz give solution
"GetSysControl@CControlView@@UBEPAXF@Z" is not same as the symbol in the widgetbin.lib. Why?
-
how can I solve this error message? "Some of your photos, including the photo “IMG_0374.jpg”, were not copied to the iPad “(my name’s) iPad” because they cannot be displayed on your iPad."
There were 273 photos in the event syncing from my Mac, but only the last 103 made it to the ipad. Most of the photos were taken by an iphone. I would appreciate any thoughts or insights - thanks.Adrian-
That error message suggests the photo is somehow corrupt.
Do you have the Apple Camera Connection Kit? You can set up a USB thumb drive with MS-DOS FAT-32 format and copy your photos to it into a folder named DCIM. Assuming they have an 8 character plus suffix name, the iPad will recognize them and give you the option of transferring them via the Kit's USB adapter.
Once they are transferred, you can find out if there is a problem with any.
Fred -
When I try to activate my home sharing on iTune I get this error message."home sharing could not be activated because an error occurred(-2146762487)" .How can I solve this problem?
I have a brand new iMac with all the newest updates etc etc, Safari logs me in without any problem but iTunes etc is just not working.. and I have the same message...Any ideas how to resolve this?
"Home Sharing could not be activated because an error occurred (5506)." -
I cant open my iphone 3g .... needs restore and itunes cant make restore has an error on phone .... how can I solve this problem?
Are there any error numbers given by iTunes? If yes, solutions for those numbers can be fund in this article: http://support.apple.com/kb/TS1275 or this one http://support.apple.com/kb/TS3694
-
I was using Aperture (3.4.1), when he appeared a notice that asked me to stop the Mac with the power button. When I restart Aperture no longer opens and the following message appears: There was an error opening the database for the library "/ Users / Andrea / Pictures / Aperture 3 Library.aplibrary."
How can I solve this problem?
ThanksAfter a system crash your Aperture Library may be corrupted, because Aperture may not have been able to finish the ongoing database transactions.
Have you tried the Aperture Library First Aid Tools?
Aperture 3 User Manual: Repairing and Rebuilding Your Aperture Library
Try "Repair Database", and if this does not help: "Rebuild Database"
Regards
Léonie -
Error from appleSyncNotifier.exe : ista pc . how can i solve this problem?
cannot find procedure xmlTextreaderConst in DDL-bestand libxml2.dll . get this always after i start up mu windows vista pc . how can i solve this problem?
What do you mean ?
Xnabil wrote:
my phone doesn't athorise in my pc .
What Troubleshooting Steps have you tried ? Any Error Messages or Alerts ? -
"It started malfunctioning so I uninstalled it".
That may have been necessary, may not have.
"I tried to reinstall and there is persistent error in installing. What is the problem?"
No clue.. you've not provided us any details.
"How can I solve this?"
Search these forums or google for the error occurring or post the error so that others can help you. -
What is error#2014? How can I solve this?
Each time I start Muse I get this error #2014. How can I solve this problem?
Hi,
Try some solution given in the following thread
http://support.muse.adobe.com/message/5398405
Please let us know if the issue persists. -
i was restore my iphone 5 but last time itune show error (-1) so how can i solve this problem?
Error -1 indicates a serious hardware failure.
Try restoring the device again, try on a different computer. If the issue continues, take the device to Apple for evaluation and possible replacement. -
What is this Configuration Error: 1 = I must reinstall the AI every time again and again and loose so much time! How can I solve this error?
please answer on my email too
[email protected]Nobody can tell you anything without proper system info or other technical details. The simply answer probably is that you are running your system with insufficient user privileges and system restore or some security tools are blocking stuff/ erasing your install.
Mylenium -
Error message 70001 appears when I am trying to change DVD zone. How can I solve this issue?
This has already been brought up before:
https://discussions.apple.com/thread/820087 -
i cant make restore for my iphone 3gs??,,,, needs restore and itunes cant make restore has an error code 2003... How can I solve this problem?
See this support document for information about update and restore errors. Resolve iOS update and restore errors
-
HT3743 I got an error no 1015 ! what does it mean ? and How Can I solve this issue?
I got an error no 1015 ! what does it mean ? and How Can I solve this issue?
Error 1015: This error is typically caused by attempts to downgrade the iPhone, iPad, or iPod touch's software. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version is not supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you are now trying to restore to an authorized, default state.
Busted...
Maybe you are looking for
-
LINUX:while Deleting OLD backup's got error that ORACLE is not in DBA group
Error Error - The specified host user is not a member of the operating system DBA group. The host user must be a DBA group member since the database user does not have the SYSDBA role. But. put users: system,oracle in OS /etc/group : oracle:x:500:ora
-
Restoring the phone possibly?
I've been reading about battery problems, and that restoring your iPhone should help with these problems (for some reason). Well, I think my iPhone 3GS is one of those phones affected by these problems of short battery life. The battery went down fro
-
IDVD Freezes when creating new project!?
Hi all, When I open iDVD, it give me the main screen, I click Create New Project. The window comes up, but it has trouble opening the stuff inside the window, and does the dreaded rainbow ball.. Never comes out of it. I have to force quit it to get o
-
Hi all, i have this problem on my EHPI, 1st my system is not installed as distirbuted.. its (CI+DB) and a DI on other server. im using aix # oslevel -s 6100-04-01-0944 I have found note Note 1140980 - sapstartsrv user authentication on AIX , using la
-
Video conversion problem: no sound
Hi, when I convert a video for iPhone / iPod touch, there is no sound in the end. Same with iTunes. What - except re-install both, which I have done already - can I do? Thanks a lot Peter