Skip to content

Commit 35c4e07

Browse files
committed
Atttempt to fix RemoteWebElement to compile with .Net Standard 2.0 and 2.1
1 parent 01d1174 commit 35c4e07

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

dotnet/src/webdriver/Remote/RemoteWebElement.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,18 @@ public virtual void SendKeys(string text)
279279
{
280280
throw new ArgumentNullException("text", "text cannot be null");
281281
}
282-
var fileNames = text.Split("\n");
282+
var fileNames = text.Split('\n');
283+
var amendedText = "";
283284
foreach (var fileName in fileNames)
284285
{
285286
if (this.driver.FileDetector.IsFile(fileName))
286287
{
287-
fileName = this.UploadFile(fileName));
288-
}
288+
amendedText += this.UploadFile(fileName) + "\n";
289+
}
290+
else
291+
{
292+
amendedText = fileName + "\n";
293+
}
289294
}
290295
// N.B. The Java remote server expects a CharSequence as the value input to
291296
// SendKeys. In JSON, these are serialized as an array of strings, with a
@@ -295,8 +300,8 @@ public virtual void SendKeys(string text)
295300
// appropriate one for spec compliance.
296301
Dictionary<string, object> parameters = new Dictionary<string, object>();
297302
parameters.Add("id", this.elementId);
298-
parameters.Add("text", text);
299-
parameters.Add("value", text.ToCharArray());
303+
parameters.Add("text", amendedText);
304+
parameters.Add("value", amendedText.ToCharArray());
300305

301306
this.Execute(DriverCommand.SendKeysToElement, parameters);
302307
}

0 commit comments

Comments
 (0)