microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
522 stars 289 forks source link

[HOW-TO] When i click on "Resolve Case" It opens up a pop up window. #812

Open dynamicsk opened 4 years ago

dynamicsk commented 4 years ago

When i click on "Resolve Case" It opens up a pop up window.

How do i enter details on that pop up and Click on Resolve button. Please help.

image

issieeman commented 4 years ago

I'm also pretty new at this, but i think to click the resolve button you have to use:

xrmApp.Dialogs.ConfirmationDialog(true); Let me know if this works.

Not sure about how to fill in the field though. please comment if you find out, i'll probably also need it in the future...

dynamicsk commented 4 years ago

Hi issieeman

Thanks for your reply. xrmApp.Dialogs.ConfirmationDialog(true); did Not work.

I managed to fill in the fields though. XrmApp.Entity.SetValue("resolution_id", "Test");

Will try different options to click on Resolve button.

mVermaat commented 4 years ago

I think this is similar to the opportunity close dialog. It's a different element. You see in that method they use a different XPATH query to press the OK button. You will need to do something like that, but create your own XPATH query.

poi023 commented 4 years ago

Hi @dynamicsk @mVermaat what command should I use to click or access this image

and select Active Cases image

dewilliams704 commented 3 years ago

Hi issieeman

Thanks for your reply. xrmApp.Dialogs.ConfirmationDialog(true); did Not work.

I managed to fill in the fields though. XrmApp.Entity.SetValue("resolution_id", "Test");

Will try different options to click on Resolve button.

@dynamicsk, did you ever come up with a solution to this? Did you need to select a new frame or anything before using XrmApp.Entity.SetValue("resolution_id", "Test");?

Shakevg commented 3 years ago

@dynamicsk You should implement a custom solution. This custom code working for me:

public void ResolveCase()
{
    const string resolveButtonId = "btnResolve";
    const string dialogFrameId = "FullPageWebResource";

    Driver.SwitchFrameWhenAvailable(DialogFrameId, TimeSpan.FromSeconds(10));
    var wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(10));
    wait.Until(FrameToBeAvailableAndSwitchToIt(dialogFrameId));
    Driver.WaitUntilAvailable(By.Id(resolveButtonId)).Click();
    Driver.SwitchTo().DefaultContent();
}
Shakevg commented 3 years ago

Hi @dynamicsk @mVermaat what command should I use to click or access this

and select Active Cases

xrmBrowser.Grid.SwitchView("Active Cases");