I am trying to click on the span with the text- clone concept. Following is the html
<ul class="context-menu-list context-menu-root" style="width: 210px; top: 500px; left: 231px; z-index: 2;">
<li class="context-menu-item">
<li class="context-menu-item">
<li class="context-menu-item disabled">
<li class="context-menu-item">
<li class="context-menu-item icon icon-evn-icon-clone-concept">
<span>Clone concept</span>
</li>
<li class="context-menu-item">
<li class="context-menu-item icon icon-delete disabled">
</ul>
the javascript code i use is:
driver.findElement(By.xpath("//span[text()='Clone concept']")).click();
I verified that this is the right for the element through firepath.
I also made sure that element is visible as per the link How to force Selenium WebDriver to click on element which is not currently visible?
Here is the computed css
font-family Verdana,?Arial,?Helvetica,?sans-serif
.context-menu-list Verdana,?Arial,?Helvetica,?sans-serif
jquery...enu.css (line 15)
body Arial,?Helvetica,?sans-serif
swa.css (line 3)
font-size 11px
.context-menu-list 11px
jquery...enu.css (line 15)
list-style-type none
.context-menu-list none
jquery...enu.css (line 15)
Also tried the following code:
WebElement foo = driver.findElement(By.xpath("//span[text()='Clone concept']"));
Actions bar = new Actions(driver);
bar.click(foo).perform();
Exception: org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with Command duration or timeout: 30.04 seconds Build info: version: '2.24.1', revision: '17205', time: '2012-06-19 16:53:24' System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0' Driver info: driver.version: RemoteWebDriver
Any help will be appreciated.
Another hack for those who get stuck here:
For the time being I have been able to move forward by splitting this huge test case into simpler test cases.