PDA

View Full Version : How to add IDs to Update and Cancel buttons in rowEditing



bbalasateesh
10 Oct 2013, 12:47 AM
Hi,

Ext-JS by default provides the dynamic ID to the elements rendered. I need to give an unique constant ID for Update and Cancel buttons in grid that are generated for rowEditing. Can anyone please let me know how to attach the IDs to Update and Cancel buttons.

Thanks,
Sateesh B.

ettavolt
10 Oct 2013, 1:57 AM
Why do you need this?

bbalasateesh
14 Oct 2013, 9:36 PM
We need to provide the id to those buttons to use that in automation tool. The IDs got changed for each rendering. In automation testing we need to provide the ID which will not change. So if we can provide the IDs to that, they will be consistent to find in the automation testing.

ettavolt
15 Oct 2013, 12:50 AM
Instead try to obtain buttons' dynamic ids through executing javascript.
Providing you can design a ComponentQuery for the grid:


Ext.ComponentQuery.query('<query for grid>')[0].editingPlugin.getEditor().getFloatingButtons().down('#update').id

or (for Cancel):


Ext.ComponentQuery.query('<query for grid>')[0].editingPlugin.getEditor().getFloatingButtons().down(':not(#update)').id

bbalasateesh
15 Oct 2013, 1:37 AM
We are using HP QTP, where we cannot use the component queries to get the id. In automation we will capture the flow and write the scripts with the IDs. If the id are changed dynamically, scripts will fail.

Please let me know if we can provide ID or name to that buttons.

Thanks,
Sateesh B.

ettavolt
15 Oct 2013, 8:06 AM
People say it is possible (https://www.google.com.ua/search?q=HP+QTP+run+javascript) to execute javascript and get the result.
I don't know a way to pass id's in config.