Thanks again for the response Condor. Unfortunately that doesn't seem to work either, it doesn't set a value in the combo, even if its in the combo's store.
I've updated my example code (see previous post) to make it easier to test a potential solution.
It also looks like the combo value is only set when the combo is included in an editable grid. The example code shows that 'hello' doesn't get set in the standalone combo.
Jit
Last edited by jit; 28 Apr 2009 at 7:13 AM.
Reason: Updated example code
I have to click in Extjs Combo box down arrow to list the elements and has to select an item from the list.
For the following code snippet it is throwing the Exception saying "org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"//img[contains(@class, 'x-form-arrow-trigger ')]"}".
I'm trying to do using Firefox driver:
long end = System.currentTimeMillis() + 5000;
RenderedWebElement resultsDiv = null;
while (System.currentTimeMillis() < end) { resultsDiv = (RenderedWebElement) driver.findElement(By.xpath("//img[contains(@class, 'x-form-arrow-trigger ')]"));
if (resultsDiv.isDisplayed())
break;
}
Am I doing something wrong?
It's a great help if some one help me on the what code snippet(Webdriver) I have to create which will click on Extjs Combobox and select one item from the above HTML.
i am using selenium on my GXT application
the scenario as following:
when inserting values on text field and click a button for example the the following source is being displayed on selenium
<?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://10.0.121.1:8080/" />
<title>test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">test</td></tr>
</thead><tbody>
<tr>
<td>focus</td>
<td>name=id</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=id</td>
<td>iii6</td>
</tr>
<tr>
<td>click</td>
<td>//body/div/div/div/div[2]/div[2]/div/div/table/tbody/tr/td[2]/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[2]/td[2]/em/button</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
the problem is when play the previous test the following error will be displayed on my application :
Error: java.lang.Throwable: com.progressoft.jfw.shared.exception.ViewException: ids for this class must be manually assigned before calling save(): com.progressoft.jfw.model.bussinessobject.core.Label; nested exception is org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): com.progressoft.jfw.model.bussinessobject.core.Label
Sorry to revive an old thread but if you are not limited to Selenium have a look at RIATest.
ExtJS UI widgets are first class citizen in RIATest. The tests in RIATest operate in terms of ExtJS UI widgets and RIATest knows that the dynamic ids must be ignored. Instead it uses widget type, its label, etc to identify it.