Всем привет.
У меня проблема с поиском элемента. Есть вот такой спан:
<span helptext="Indicate if currently, or within the past 12 months, the client had any long-term care insurance policies or riders (including healthcare service or health maintenance organization contracts) in force or pending." class="dataControl HasHelpText" id="ctl08_ctl02_ctl03_ctl01_ctl00_ctl02_ctl06_ctl02_ctl01_ctl02_ctl01_sb0x0">
Получается найти его только по полному xPath/CssPath или id, но это не устраивает, т.к. может поменяться. Пробовал следующие варианты поиска:
[FindsBy(How = How.XPath, Using = "//td[contains(text(),'Currently, or within the past 12 months, has the client had any long-term care insurance policies or riders (including healthcare service or health maintenance organization contracts) in force or pending?')]/following-sibling::*/span")]
[FindsBy(How = How.XPath, Using = "//span[@helptext='Indicate if currently, or within the past 12 months, the client had any long-term care insurance policies or riders (including healthcare service or health maintenance organization contracts) in force or pending.']")]
[FindsBy(How = How.CssSelector, Using = "span[helptext='Indicate if currently, or within the past 12 months, the client had any long-term care insurance policies or riders (including healthcare service or health maintenance organization contracts) in force or pending.']")]
Метод:
public void FillQuestionnairePage(string user, string env)
{
devLTCQuestion1.FindElement(By.CssSelector("input[value='False']")).Click();
}
Эти варианты не работают. В Nunit появляется ошибка “Element is not currently visible and so may not be interacted with”.
Версия WebDriver 2.53
Вопрос: Почему возникает эта ошибка и как это исправить?
Буду благодарен за помощь.
Скрин кода ниже:
Скрин страницы: