How do you use WatiN to click the Ajax Toolkit TabContainer header?
I have an ajax tooling TabContainer control on my page with two tabs. In my test, I would like to switch between tabs.
I tried to _ie.Span("tabHeaderID").Click()
, .MouseDown()
, .FireEvent("onclick")
. I've tried the same methods on the parent span elements as well.
I also tried Eval-ing javascript to set the active index like so:
_ie.Eval("$get(\"ctl00_AdminContentPlaceHolder_TabContainer1\").set_activeTabIndex(1);");
Has anyone used WatiN successfully to switch tabs?
source to share
I have not figured out how to simulate clicking on the title of a tab. However, I have a way to get to the second tab - just a slight variation on the eval description from my original post:
_ie.Eval ("$ find (\" ctl00_AdminContentPlaceHolder_TabContainer1 \ ") set_activeTabIndex (1).");
It uses $ find instead of $ get to get the tab container object.
source to share