IList<IWebElement> all = driver.FindElements(By.ClassName(textBox1.Text)); String[] allText = new String[all.Count]; int i = 0; foreach (IWebElement element in all) { allText[i++] = element.Text; listBox1.Items.Add(element); }
listBox1.Items.Add(labels);