So I'm currently writing this script that will automate a simple, monotonous task using the Selenium Internet Explorer driver in C#.
Everything works great, but it is a tad bit slow at one point in the script and I'm wondering if there is a quicker way available to do what I want.
The point in question is when I have to fill out a textbox with a lot of information. This textbox will be filled sometimes up to 10,000 lines where each line never exceeds 20 characters.
However, the following approach is very slow...
// process sample file using LINQ query
var items = File.ReadAllLines(sampleFile).Select(a => a.Split(',').First());
// Process the items to be what we want to add to the textbox
var stringBuilder = new StringBuilder();
foreach (var item in items)
{
stringBuilder.Append(item + Environment.NewLine);
}
inputTextBox.SendKeys(stringBuilder.ToString());
Is there any to just set the value of the textbox to what I want? Or is this a bottleneck?
Thank you for your time and patience!