Unable to locate element against ZK frame work

I am doing a testing against ZK frame work with selenium IDE .. it works fine .. but with selenium web-driver .. it did not it shows that unable to locate an element with the selenium web-driver .. the web driver can not locate an element in grid table .. I try to Scroll into view .. and I Try List .. all of them did not work .. when I try with move mouse it works .. but I cant assert or verify ..

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://*****/>
<title>work it2</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">work it2</td></tr>
</thead><tbody>
<tr>
    <td>open</td>
    <td>/xxx</td>
    <td></td>
</tr>
<tr>
    <td>click</td>
    <td>//li[2]/div/div/div/span</td>
    <td></td>
</tr>
<tr>
    <td>pause</td>
    <td>3000</td>
    <td>3000</td>
</tr>
<tr>
    <td>doubleClick</td>
    <td>//div[2]/div[2]</td>
    <td></td>
</tr>
<tr>
    <td>pause</td>
    <td>3000</td>
    <td>3000</td>
</tr>
</tbody></table>
</body>
</html>

And this is the Java code ..

driver.get("xxx");

        driver.findElement(By.xpath("//li[2]/div/div/div/span")).click();
        Thread.sleep(3000);
        WebElement ee = driver.findElement(By.xpath("//div[2]/div[2]")); // Unable to locate the element 
        Actions action = new Actions(driver);
        action.doubleClick(ee).perform();
        Thread.sleep(3000);

Any Ideas?

Answers


As far as I understand, the table contains XPath expressions which you want to find by string comparison. To do so, find table cells those content equals the query string you're looking for.

driver.findElement(By.xpath("//td[.='//li[2]/div/div/div/span']")).click();

Same applies to the other statement:

WebElement ee = driver.findElement(By.xpath("//td[.='//div[2]/div[2]']"));

The problem is how to locate an element in ZK application after I Click in a button .. and the grid table display .. and I can not locate any element inside it ..


Need Your Help

unaligned memory accesses

video assembly embedded alignment decoding

I'm working on an embedded device that does not support unaligned memory accesses.