Atttempt to fix RemoteWebElement to compile with .Net Standard 2.0 and 2.1
@@ -279,12 +279,17 @@ public virtual void SendKeys(string text)
{
throw new ArgumentNullException("text", "text cannot be null");
}
- var fileNames = text.Split("\n");
+ var fileNames = text.Split('\n');
+ var amendedText = "";
foreach (var fileName in fileNames)
{
if (this.driver.FileDetector.IsFile(fileName))
{
- fileName = this.UploadFile(fileName));
+ amendedText += this.UploadFile(fileName) + "\n";
+ }
+ else
+ {
+ amendedText = fileName + "\n";
}
}
// N.B. The Java remote server expects a CharSequence as the value input to
@@ -295,8 +300,8 @@ public virtual void SendKeys(string text)
// appropriate one for spec compliance.
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("id", this.elementId);
- parameters.Add("text", text);
- parameters.Add("value", text.ToCharArray());
+ parameters.Add("text", amendedText);
+ parameters.Add("value", amendedText.ToCharArray());
this.Execute(DriverCommand.SendKeysToElement, parameters);
}
