I have an ajax toolkit TabContainer control on my page with a couple tabs. In my test, I would like to switch between the tabs.
我的页面上有一个带有几个标签的ajax工具包TabContainer控件。在我的测试中,我想在标签之间切换。
I've tried _ie.Span("tabHeaderID").Click()
, .MouseDown()
, .FireEvent("onclick")
. I've tried these same methods on the parent span elements as well.
我已经尝试了_ie.Span(“tabHeaderID”)。Click(),. MouseDown(),.FireEvent(“onclick”)。我也在父span元素上尝试过这些相同的方法。
I've also tried Eval-ing some javascript to set the active index like so:
我也试过Eval一些javascript来设置活动索引,如下所示:
_ie.Eval("$get(\"ctl00_AdminContentPlaceHolder_TabContainer1\").set_activeTabIndex(1);");
Has anyone successfully used WatiN to switch tabs?
有没有人成功使用WatiN来切换标签?
1 个解决方案
#1
I have not figured out how to simulate a click on the tab header. However, I do have a way to get to the second tab - just a small variation on the eval statement from my original post:
我还没想出如何模拟标签页面上的点击。但是,我确实有办法进入第二个标签 - 只是我原始帖子中eval语句的一个小变体:
_ie.Eval("$find(\"ctl00_AdminContentPlaceHolder_TabContainer1\").set_activeTabIndex(1);");
It uses $find instead of $get to get the tab container object.
它使用$ find而不是$ get来获取tab容器对象。
#1
I have not figured out how to simulate a click on the tab header. However, I do have a way to get to the second tab - just a small variation on the eval statement from my original post:
我还没想出如何模拟标签页面上的点击。但是,我确实有办法进入第二个标签 - 只是我原始帖子中eval语句的一个小变体:
_ie.Eval("$find(\"ctl00_AdminContentPlaceHolder_TabContainer1\").set_activeTabIndex(1);");
It uses $find instead of $get to get the tab container object.
它使用$ find而不是$ get来获取tab容器对象。