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 sometimes ‘timeout’ appears.
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 the same as soon as possible?