microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
513 stars 286 forks source link

Not able to click on Deactivate contact button #1284

Open aniramibanerjee opened 2 years ago

aniramibanerjee commented 2 years ago

Not able to click on Deactivate contact button .

Tried with taking xpath for Deactivate button in the pop up and trying to call the same from the class file.Stored the object refrence in element refrence.

xpath- //*[starts-with(@id, 'dialogContentContainer')]//button[@aria-label = 'Deactivate']

Code used

            xrmApp.ThinkTime(3000);
            xrmApp.CommandBar.ClickCommand("Deactivate");
            xrmApp.ThinkTime(5000);
            //not working
            xrmApp.CommandBar.ClickCommand("deacti");
            xrmApp.ThinkTime(3000);

it;'s not clicking on the Deactivate button in the popup and not able to find any frame or window .Please help me to fix this issues .

tipsey commented 2 years ago

Have you tried using:

  1. xrmApp.Dialogs.ClickCommand....
  2. using client.Browser.Driver.LastWindow(); after the popup
aniramibanerjee commented 2 years ago

HI @tipsey I have tried xrmApp.Dialogs.ClickCommand("deacti"); using client.Browser.Driver.LastWindow()

and adding deacti xpath in element reference {"deacti", "//*[starts-with(@id, 'dialogContentContainer')]//button[@aria-label = 'Deactivate']" }