When trying to sendkeys to the new e-mail window on Outlook I get the following error
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: An unknown error occurred in the remote end while processing the command. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'WVA01000004', ip: '10.200.153.43', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_212'
Driver info: io.appium.java_client.windows.WindowsDriver
Capabilities {app: Root, deviceName: WindowsPC, javascriptEnabled: true, platform: WINDOWS, platformName: WINDOWS}
When interacting with this window I've created a new session and then I attempt to sendkeys with the new driver session but I still get an unknown error message. While the test is running it looks as though it clicks into the element and when it then attempts to pass the String into the element it fails.
`
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("app", "Root");
driver = new WindowsDriver(new URL("http://127.0.0.1:4723"),capabilities );
driver.findElementByName("Page 1 content").sendKeys("PLEASE WORK!");
`
I've read up on previous issues with this error and I've made sure to run WinAppdriver with admin privileges. The output from WinAppDriver is below.
`==========================================
POST /session/E0D15E60-CDED-4FC6-AC48-4AC22FC9208D/element HTTP/1.1
Accept-Encoding: gzip
Connection: Keep-Alive
Content-Length: 50
Content-Type: application/json; charset=utf-8
Host: 127.0.0.1:4723
User-Agent: selenium/3.141.59 (java windows)
{
"using": "name",
"value": "Page 1 content"
}
HTTP/1.1 200 OK
Content-Length: 99
Content-Type: application/json
{"sessionId":"E0D15E60-CDED-4FC6-AC48-4AC22FC9208D","status":0,"value":{"ELEMENT":"42.723236.4.2"}}
==========================================
POST /session/E0D15E60-CDED-4FC6-AC48-4AC22FC9208D/element/42.723236.4.2/value HTTP/1.1
Accept-Encoding: gzip
Connection: Keep-Alive
Content-Length: 64
Content-Type: application/json; charset=utf-8
Host: 127.0.0.1:4723
User-Agent: selenium/3.141.59 (java windows)
{
"id": "42.723236.4.2",
"value": [
"PLEASE WORK!"
]
}
HTTP/1.1 500 Internal Error
Content-Length: 133
Content-Type: application/json
{"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}
==========================================
DELETE /session/5D01D8E1-20DC-4F21-9430-3ECF7EDA08AE HTTP/1.1
Accept-Encoding: gzip
Connection: Keep-Alive
Content-Length: 0
Host: 127.0.0.1:4723
User-Agent: selenium/3.141.59 (java windows)
HTTP/1.1 200 OK
Content-Length: 12
Content-Type: application/json
{"status":0}`
Make sure you don't have anything on your second desktop too, it can cause error similar to this unless you're managing your WindowHandle.. Try improving your 'driver', my named 'session' looks like this:
AppiumOptions opt = new AppiumOptions();
opt.AddAdditionalCapability("app", MyApplicationAppId);
opt.AddAdditionalCapability("deviceName", "WindowsPC");
session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), opt);
My simple login test, since I already have focus in that field and saved password I only need to provide login and click to get in. Perhaps your precision isn't enough with just 'name'?
[TestMethod]
public void LogIN()
{
session.FindElementById("cmbLogin").SendKeys("zam6.fire");
session.FindElementByAccessibilityId("btnLogin").Click();
}
Hi mate, thanks for the reply. I am handling the window handles as its a new window so its the only way to interact with it. I am able to interact with the window in other ways such as clicking elements on the window so I know the driver is picking up the window just fine. But SendKeys just continues to throws an error. I ended up using Actions as a workaround.
@OhAye, Actions would be recommended as a workaround. Filing this as a bug for SendKeys.
Hi, @hassanuz that's great thanks for filing as a bug if you need any further information from me just let me know.
@OhAye Can show it here how you do it? I do need also this workaround right now to automate the sending of email on Outlook.
Hi @nbulusanjr - I've added my code below, I'm using Java so I hope this helps.
`WebElement emailAddressInput = driver.findElementByName("To");
WebElement mailContent = driver.findElementByName("Page 1 content");
WebElement subjectInput = driver.findElementByAccessibilityId("4101");
Actions performAct = new Actions(driver);
performAct.sendKeys(mailContent, mailText).build().perform();
performAct.sendKeys(emailAddressInput, toText).build().perform();
performAct.sendKeys(subjectInput, subjectText).build().perform();`