Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Please search before posting, I have been answering this over and over.</p> <p>ExtJS pages are hard to test, especially on finding elements.</p> <p>Here are some of the tips I consider useful:</p> <ul> <li>Don't ever use dynamically generated IDs. like <code>(:id, 'ext-gen1345')</code></li> <li><p>Don't ever use absolute/meaningless XPath, like <code>//*[@class='someclass']/li/ul/li[2]/ul/li[2]/table/tbody/tr/td[2]/div</code></p></li> <li><p>Take advantage of meaningful auto-generated partial ids and class names. (So you need show more HTML in your example, as I can make suggestions.)</p> <p>For example, <a href="http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/build/KitchenSink/ext-theme-neptune/#array-grid" rel="nofollow noreferrer">this</a> ExtJS grid example: <code>(:css, '.x-grid-view .x-grid-table')</code> would be handy. If there are multiple of grids, try index them or locate the identifiable ancestor, like <code>(:css, '#something-meaningful .x-grid-view .x-grid-table')</code>. In your case, <code>(:css, '#something-meaningful .x-form-arrow-trigger')</code></p></li> <li><p><strong>Take advantage of button's text.</strong></p> <p>For example, <a href="http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/build/KitchenSink/ext-theme-neptune/#contact-form" rel="nofollow noreferrer">this</a> ExtJS example: you can use XPath <code>.//li[contains(@class, 'x-boundlist-item') and text()='Rescue']</code>. However, this method is not suitable for CSS Selector or multi-language applications.</p></li> <li><p>The best way to test is to create meaningful class names in the source code. If you don't have the access to the source code, please talk to your manager, using Selenium against ExtJS application should really be a developer's job. ExtJS provides <code>cls</code> and <code>tdCls</code> for custom class names, so you can add <code>cls:'testing-btn-foo'</code> in your source code, and Selenium can get it by <code>(:css, '.x-panel .testing-btn-foo')</code>.</p></li> </ul> <p>Other answers I made on this topic:</p> <ul> <li><a href="https://stackoverflow.com/a/19531840/1177636">How to find ExtJS elements with dynamic id</a></li> <li><a href="https://stackoverflow.com/a/18047730/1177636">How to find unique selectors for elements on pages with ExtJS for use with Selenium?</a></li> <li><a href="https://stackoverflow.com/a/9061747/1177636">How to click on elements in ExtJS using Selenium?</a></li> <li><a href="https://stackoverflow.com/a/18840310/1177636">Using class names in Watir</a></li> <li><a href="https://stackoverflow.com/a/17308416/1177636">how to click on checkboxes on a pop-up window which doesn't have name, label</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload