I am writing a test script in selenium webdriver(selenium 2.0) with C# for below html-
<table id="A_switch" class="tabswitch">
------
</table>
<div id="A" class="page ribbonpage">
<div id="B" class="ribbongroup">
-------
<div>
</div>
When i click in above table applied CSS for above and get replaced like below-
<table id="A_switch" class="tabswitch selected">
</table>
<div id="A" class="page ribbonpage selected">
<div id="B" class="ribbongroup">
--
<div>
</div>
In this test script,after clicking on this table i am finding and clicking on <div id="B”>
Everything is working fine in Visual studio debug mode only.When i am running it without breakpoint (release mode) sometimes "invisible element" exception and sometime ‘timeout’ appers.
when i searched over google it looks very generic error and should be fixed with below code -
WebDriverWait waittime = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
var element = waittime.Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@id=’B’]/div[2]")));
Actions act = new Actions(driver);
act.MoveToElement(element).Perform();
element.Click();
it is not working in my case and also, no luck if increase timeout.
Could somebody help me on same as soon as possible.