Atata - 如何访问隐藏菜单
Atata - How to access hidden menu
我是 Atata 框架的新手,正在尝试访问下面的隐藏导航菜单,但没有成功
<li class="absoluteContainer">
<span id="aboutTheProject" class="isUpperCase hasDropDownLinks">ABOUT THE PROJECT</span>
<ul class="navBlockLinksAreaSubLinkDropDown verticalMenu hidden">
<li>
<a title="Link to 'Vision' page on this site" href="/Vision" class="isUpperCase menuLink">Vision</a>
</li>
<li>
<a title="Link to 'Benefits' page on this site" href="/Benefits" class="isUpperCase menuLink">Benefits</a>
</li>
<li>
<a title="Link to 'Route' page on this site" href="/Route" class="isUpperCase menuLink">Route</a>
</li>
</ul>
</li>
点击 'ABOUT THE PROJECT' 使菜单可见,但 Atata 甚至无法点击它,尽管它也被声明为 link 或标签。尝试了很多选项,如下所示,但还没有成功。
//[FindById("aboutTheProject")]
//[FindByClass("navBlockLinksAreaSubLinkDropDown verticalMenu hidden")]
//[FindByXPath("/html/body/div[1]/div[3]/ul/li[1]")
// > span#aboutTheProject.isUpperCase.hasDropDownLinks
//[FindByCss("body > div.navBlock.headroom.gridContainer.navBlockLayout.headroom--top.headroom--not-bottom > div.navBlockLinksArea > ul > li.absoluteContainer")]
//[FindByCss("body > div.navBlock.headroom.gridContainer.navBlockLayout.headroom--top.headroom--not-bottom > div.navBlockLinksArea > ul > li.absoluteContainer > ul", Visibility = Visibility.Hidden)]
//[FindByLabel("ABOUT THE PROJECT")]
//[FindByName("ABOUT THE PROJECT")]
[FindById("aboutTheProject")]
public Label<HomePage> AboutTheProject { get; private set; }
//public LinkDelegate<HomePage, TOwner> AboutTheProject { get; private set; }
'ABOUT THE PROJECT' 是 <span>
元素。你不应该为它使用 Label
控件,因为它与 <label>
元素一起工作。你可以看看控件class的控件定义。对于您的情况,您可以只使用通用 Control
class:
[FindById("aboutTheProject")]
public Control<HomePage> AboutTheProject { get; private set; }
我是 Atata 框架的新手,正在尝试访问下面的隐藏导航菜单,但没有成功
<li class="absoluteContainer">
<span id="aboutTheProject" class="isUpperCase hasDropDownLinks">ABOUT THE PROJECT</span>
<ul class="navBlockLinksAreaSubLinkDropDown verticalMenu hidden">
<li>
<a title="Link to 'Vision' page on this site" href="/Vision" class="isUpperCase menuLink">Vision</a>
</li>
<li>
<a title="Link to 'Benefits' page on this site" href="/Benefits" class="isUpperCase menuLink">Benefits</a>
</li>
<li>
<a title="Link to 'Route' page on this site" href="/Route" class="isUpperCase menuLink">Route</a>
</li>
</ul>
</li>
点击 'ABOUT THE PROJECT' 使菜单可见,但 Atata 甚至无法点击它,尽管它也被声明为 link 或标签。尝试了很多选项,如下所示,但还没有成功。
//[FindById("aboutTheProject")]
//[FindByClass("navBlockLinksAreaSubLinkDropDown verticalMenu hidden")]
//[FindByXPath("/html/body/div[1]/div[3]/ul/li[1]")
// > span#aboutTheProject.isUpperCase.hasDropDownLinks
//[FindByCss("body > div.navBlock.headroom.gridContainer.navBlockLayout.headroom--top.headroom--not-bottom > div.navBlockLinksArea > ul > li.absoluteContainer")]
//[FindByCss("body > div.navBlock.headroom.gridContainer.navBlockLayout.headroom--top.headroom--not-bottom > div.navBlockLinksArea > ul > li.absoluteContainer > ul", Visibility = Visibility.Hidden)]
//[FindByLabel("ABOUT THE PROJECT")]
//[FindByName("ABOUT THE PROJECT")]
[FindById("aboutTheProject")]
public Label<HomePage> AboutTheProject { get; private set; }
//public LinkDelegate<HomePage, TOwner> AboutTheProject { get; private set; }
'ABOUT THE PROJECT' 是 <span>
元素。你不应该为它使用 Label
控件,因为它与 <label>
元素一起工作。你可以看看控件class的控件定义。对于您的情况,您可以只使用通用 Control
class:
[FindById("aboutTheProject")]
public Control<HomePage> AboutTheProject { get; private set; }