XRM-OSS/D365-UI-Test

Ribbon Flyout Buttons

Closed this issue ยท 12 comments

Hi @DigitalFlow ,

Thanks a lot for your framework!
I've just started trying it out and I didn't find a way to call ribbon buttons that are inside a flyout.
Is there a way to call a button inside a button like in the here?
image

Thanks in advance.
Gustavo

Hi @gyepescalle,

Can you try the following:

await xrmTest.Button.click({ byLabel: "Process" });
await xrmTest.Button.click({ byLabel: "Switch Process" });

Kind Regards,
Florian

Hi @DigitalFlow ,

Thanks for your answer.
Clicking a button byLabel never works for me, clicking byDataId does.
Your suggestion works sometimes: Sometimes the framework finds the second button, but most times it searches for it on the ribbon. I guess it's a timing issue:

For example:
Test:

test("Validate new account", async () => {          
        await xrmTest.Navigation.openUpdateForm("account", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
        await xrmTest.Button.click({ byDataId: "account|NoRelationship|Form|Mscrm.HomepageGrid.account.MBPF.ConvertTo" });
        await xrmTest.Button.click({ byDataId: "account|NoRelationship|Form|Mscrm.Form.account.Mscrm.Form.account.Reactivate" });
        //await xrmTest.Entity.save
        
    });

Result:

Failed to find button
      88 | 
      89 |         await xrmTest.Button.click({ byDataId: "account|NoRelationship|Form|Mscrm.HomepageGrid.account.MBPF.ConvertTo" });
    > 90 |         await xrmTest.Button.click({ byDataId: "account|NoRelationship|Form|Mscrm.Form.account.Mscrm.Form.account.Reactivate" });

Kind regards,
Gustavo

Hi @gyepescalle,

thanks for your input.

Good to know that it works sometimes and sometimes not, so this is only a timing issue.
I should probably add a call to waitForIdleness after clicking a button, in the meantime you can add it to your code:

await xrmTest.Button.click({ byDataId: "account|NoRelationship|Form|Mscrm.HomepageGrid.account.MBPF.ConvertTo" });
await xrmTest.waitForIdleness();
await xrmTest.Button.click({ byDataId: "account|NoRelationship|Form|Mscrm.Form.account.Mscrm.Form.account.Reactivate" });

Can you try whether this works without issues?

Kind Regards,
Florian

Hi @DigitalFlow,

That worked for me :)
Again, thanks a lot for your framework and quick feedback!

Kind regards,
Gustavo

Hi @gyepescalle,

Thanks a lot, I'll add the waitForIdleness statement to the click function by default in the next release, I'll notify you then :)
Closing this issue.

Kind Regards,
Florian

Hi @gyepescalle,

If you want you can update to v0.1.16. This release adds automatic waiting after clicking a button, so you should be able to remove the xrmTest.waitForIdleness() call without issues.

Kind Regards,
Florian

Hi @DigitalFlow that worked.
Thanks :)
Gustavo

Hi @DigitalFlow,
I have 2 unrelated questions. Just asking them here because I wasn't sure how else to contact you.

  1. Does D365-UI-Test support On Prem UCI?
  2. Does D365-UI-Test support native browser login prompts?

Thanks a lot.

Kind regards,
Gustavo

Hi @gyepescalle,

  1. On Prem UCI is supported, yes. I only tested it with Single Sign On or ADFS login page however.
  2. You mean the browser popups for (NTLM) authentication? This is not yet implemented. I guess this could be done, but would need to verify.

Kind Regards,
Florian

Thanks @DigitalFlow ,

With 2. I mean the browser popup yes, it is actually for ADFS. I'll check if I can ask the dev team to configure it to login in the page instead of the popup.

Kind regards,
Gustavo

PS: you don't need to capitalize the R in "Kind regards" :)

Hi @gyepescalle,

awesome, just let me know in case they could not show an ADFS login page (which should be possible normally, but who knows).
You would then have to pass the CSS selectors for the username and login field of the ADFS login page as described here.

Thanks for pointing out my capitalization issue, I'm German and for us it's easy to not think a lot about it and write some words in capital letters, as this is done way more often in German than in English.

Kind regards,
Florian :)

Thanks again @DigitalFlow
I'll give it a try if the ADFS login page config is possible.
About the capitalization I'm also not a native speaker but somebody taught me this some time ago, so today I'm returning the favor and indeed, German doesn't kid with capitalization :)

Kind regards,
Gustavo