SelectOptionAsync
Описание: метод выбирает option из элемента select по указанному индексу, тексту или значению.
Синтаксис: SelectOptionAsync(string by, string value)
Возвращаемое значение: отсутствует
Пример:
Tester tester = new Tester(browserForm);
await tester.TestBeginAsync();
await tester.GoToUrlAsync("https://somovstudio.github.io/test2.html", 5);
HTMLElement element = await tester.GetElementAsync(Tester.BY_XPATH, "//*[@id='MySelect']");
await element.SelectOptionAsync(HTMLElement.BY_INDEX, "2");
await element.SelectOptionAsync(HTMLElement.BY_VALUE, "Mobile");
await element.SelectOptionAsync(HTMLElement.BY_TEXT, "Other");
string index = await element.GetOptionAsync(HTMLElement.BY_INDEX);
string text = await element.GetOptionAsync(HTMLElement.BY_TEXT);
string value = await element.GetOptionAsync(HTMLElement.BY_VALUE);
...
await tester.TestEndAsync();
Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor