Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tracing DOM element id back to its ExtJs component

We are develpoing a web-based automation solution for a web application that is built using ExtJs.

Currently i am testing various different object identification techniques that identify web elements in the best way.

We'd like to use the IE developer tools (F12) to highlight and select DOM objects on the page, and (somehow) get their corresponding ExtJs component (along with its corresponding properties, such as itemId).

Is this possible to do through code or through some other technique?

like image 941
lysergic-acid Avatar asked Jan 28 '26 09:01

lysergic-acid


1 Answers

I am unfamiliar with IE Dev tools for such things, however I can attempt to answer targeting specific components and their elements.

You can target Ext components via several ways:

  1. Ext.ComponentQuery.query(CQselector) method (see docs for examples)
  2. Ext.getCmp(componentID) if you know component ID
  3. up() and down() methods from any container/component. these also take CQselector expressions

Any of these methods are accessible from the page since Ext library is loaded. In browsers like FF and Chrome you can execute these methods directly from the console. I am guessing similarly they should be available in IE Dev tools.

Once you have reference to the Ext component you can get HTML elements through .dom or .el or similar properties. Or you could use Dom query directly.

like image 81
dbrin Avatar answered Jan 29 '26 23:01

dbrin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!