I'm using browser automation software to run automated UI tests. Our front end site uses Vue and ag-grid. My browser automation software essentially allows us to use typical javascript/jquery selectors to interact w/ the UI automatically.
I'm trying to get our browser automation software to check boxes in an ag-grid checkbox, inside an ag-grid.
I am not a Vue developer, so I was trying the typical things I'd do. Things like:
$('.ag-selection-checkbox').click();
But nothing I do actually clicks and selects to box. Any advice would be greatly appreciated.
UPDATE For those in my situation. I used the ag API like so:
document.querySelector('#myGrid').__vue__
.gridOptions.api.forEachNode((row,index) => {
document.querySelector('#myGrid').__vue__.
gridOptions.api.getRowNode(row.id).selectThisNode(true);
}
)
Try using the class that is directly associated with the checkbox, in this case it would be the class applied to the input element: ag-input-field-input ag-checkbox-input
.
You can get the checkbox of the first row like this:
const checkbox = document.querySelector('.ag-center-cols-viewport .ag-row .ag-checkbox-input');
checkbox.click();
Please see this example showcasing a row selection via the DOM based on the button click.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments