Open hicks86 opened 5 years ago
I don't know anything about Microsoft Word Addins. I do know a bit about Word automation. Eventually I intend to determine if WinAppDriver can be used to test an application which is an automation of Word.
Your application appears to run locally. If correct and you are attempt to access a single Word Document from two task, then you are experiencing a limitation of Microsoft Word. As I understand things (you will need to get a confirmation from a real live honest to goodness Microsoft employee) Word documents cannot be shared locally. They can only be shared via the cloud.
Hi @DLightstone thank you for your reply, the problem isn't with the word document being accessible remotely (although the error message does suggest that) though. Both the E2E test (MsTest) and the word document is local.
Just to clarify I have been using the Appium and WinAppdriver on a number of integration tests which have been working fine. The only difference is this would be a longer process where I am interacting with the addin.
Also just to clarify the addin is just a WinForm application that is bundled as an Addin by a third party provider (Addin Express).
@hicks86 I had determined that the application under test and the testing application were both executing locally.
The issue of concern was whether they both needed to access the Word Document. I have been lead to believe that this is not possible, and suspected that an attempt to do so will lead to a command execution failure. (manifested in this case as "Could not proxy command to remote server." )
The basis for the issue of concern is located at the following web address https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-msoffice_custom-mso_2016/does-microsoft-word-all-local-sharing/66632614-d7c4-43ea-a764-b7ba83fec17e?messageId=d7e5491d-2061-4c32-8707-5c1389052e3d
Ok so I think I have managed to get around this issue.
Essentially I am looping through a list of items on the app, and clicking them in turn. I was using a Thread.Sleep() after clicking to wait for the UI to catch up so I can validate the result. This seemed like it was throwing the communication out of sync with the Appium server. The way I am approaching it is to use Selenium Wait.Until() method.
So originally I was doing something like this:
for (int i = 0; i < issueItems.Count; i++)
{
var item = issueItems[i];
Session.Mouse.MouseMove(listElement.Coordinates, OffsetX, OffSetY);
Session.Mouse.Click(null);
Thread.Sleep(TimeSpan.FromSeconds(1)); //Wait for UI to catchup
Assert.IsTrue(item.Text.Contains("XXX"));
}
However now doing this:
WebDriverWait wait = new WebDriverWait(Session, TimeSpan.FromSeconds(20));
wait.Until((d) =>
{
try
{
var item = issueItems[i];
Session.Mouse.MouseMove(listElement.Coordinates, OffsetX, OffSetY);
Session.Mouse.Click(null);
Assert.IsTrue(item.Text.Contains("XXX"));
return true;
}
catch (Exception)
{
return false;
}
});
For now this seems to be working a treat. However I would still love to know if the "Could not proxy command...." is related to the use of the heavy handed Thread.Sleep(). Any insights?
Interesting @hicks86, thanks for posting the work around.
I'm curious if the original error would have still persisted if you bypassed Appium and connected to WinAppDriver.exe directly?
Hi @hassanuz are you able to point me in the direction of a "How to" connect directly to the WinAppdriver.exe? I will try it out.
Hi @hassanuz are you able to point me in the direction of a "How to" connect directly to the WinAppdriver.exe? I will try it out.
Ignore this, just a case of RTFM in the ReadMe section of this repo. Was on Mobile before now back on laptop
Hi guys,
Working on a project that runs an End-to-End test on our application that is a Microsoft Word Addin. Essentially the application fires up Word with a particular document, then using Appium to interact with our application trying to verify certain scenarios are working etc.
Our problem is that we continue to run into the following exception during our run:
System.InvalidOperationException: 'An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: Error: connect ECONNREFUSED 127.0.0.1:4724'
Occurs when the E2E test has been running for a bit.
I have a feeling the way I need to deal with this issue is to catch it and try and re-connect?
If you need any more information please let me know
Appium Server Log