I’m hoping someone can help me on this thread, even though I know it says ‘Beyond the UI’. I’ve recently started testing D365 as well but I want a faster way to set up test data. At the moment, I am creating a customer account manually. There is currently no API set up so that is not an option and the developer will not allow us to do import/export (for whatever reason). That leaves me with trying to do automatic form filling but I am trouble with this.
I posted the same question on https://stackoverflow.com/questions/63374896/how-do-i-automate-form-filling-in-ms-dynamics-365.
Here it is:
On Chrome, I tried to do the following to edit an existing account / submit a new account. I can confirm the elements are definitely correct because the browser highlights them.
document.querySelector('input[aria-label="Account Name"]').title='Test Company'
document.querySelector('input[aria-label="Account Name"]').value='Test Company'
I can see that the field name changes for the account name but hitting save fails. In the case of the edit account scenario, it reverts back to the old name. In the new account scenario, it doesn’t save the account successfully.
The ideal scenario would be for me to generate company data and have the forms filled in for me as well. But if that doesn’t work then I can always copy paste the company data into the script (not sure that would be any faster than manual testing to be honest).