FocusElementAsync

Parent Previous Next

FocusElementAsync

Описание: метод переключает фокус на указанный элемент

Синтаксис

FocusElementAsync(string by, string locator)

FocusElementAsync(Locator locator)

Возвращаемое значение: отсутствует


Пример:

await tester.FocusElementAsync(Tester.BY_CSS, "input[id='login']");

await tester.SetValueInElementAsync(Tester.BY_CSS, "input[id='login']", "admin");


await tester.FocusElementAsync(Tester.BY_XPATH, "//input[@id='login']");

await tester.SetValueInElementAsync(Tester.BY_XPATH, "//input[@id='login']", "admin");


await tester.FocusElementAsync(tester.GetLocatorValue("locatorName"));

await tester.SetValueInElementAsync(tester.GetLocator("locatorName"), "admin");

Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator