microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
520 stars 288 forks source link

On ClickCommand object reference isn't set to instance of object error is coming #1087

Open badarmunirr opened 3 years ago

badarmunirr commented 3 years ago

Bug Report

Issues should only be created for items related to covered functionality.

Not covered functionality, feature requests, and questions should use the Feature Request or Question templates.

EasyRepro Version

UCI or Classic Web

Online or On Premise

Browser

Describe the bug
When the user uses clickcommand it's throwing object reference error.

Special formatting / display

image

Code to reproduce
xrmApp.CommandBar.ClickCommand(); xrmApp.Entity.SubGrid.ClickCommand();

ryanpiran commented 3 years ago

I've also got this issue

badarmunirr commented 3 years ago

I think this is because Microsoft has changed the UI I was able to find a workAround using Xpath

Keyshon commented 3 years ago

Looks like a duplicate for https://github.com/microsoft/EasyRepro/issues/1082 The DOM has been changed recently, while the newest version of EasyRepro is not yet released, as we found out it is related to Related Grid, Quick Create, and possibly, something else.

samnbrone commented 3 years ago

It's the FindElements(By.TagName("li")) in WebClient.cs

The list items do not have the aria-label attribute, so GetAttribute returns null, and the code inside the subsequent if statement does not execute.

I've changed to FindElements(By.TagName("button")) which have the aria-label attribute. Seems to work alright!

badarmunirr commented 3 years ago

@samnbrone also check for subgrid if your code works fine for subgrid push your code .

badarmunirr commented 3 years ago

@SAMNBRONE faced similar object reference issue with GetValue and GetHeaderValue and also with opensubarea

badarmunirr commented 3 years ago

@3dmundbarton also change line number 2082 in webclient.cs var subGridButtons = subGrid.FindElements(By.TagName("button")); this will fix the subgrid clickcommand issue and also if you can change line number 208 to var input = driver.WaitUntilVisible(By.XPath(Elements.Xpath[Reference.Login.LoginPassword])); this will fix the login issue

3dmundbarton commented 3 years ago

this looks to be fixed with the latest version 9.2.21014.138 - consider closing?

DavidPezzoli commented 3 years ago

Now, for me, ClickCommand("New") work fine....also in a different default language as Italian: ClickCommand("Nuovo").

Thanks!

smallteam1 commented 3 years ago

After updating the latest version, I am getting a new issue

This login.microsoftonline.com page can’t be found System.Exception: App Name Customer Service not found.

Might be issue with this command : xrmApp.Navigation.OpenApp("Customer Service");

one more observation is previously apps are displaying in content area, but now apps are displaying in dialog box(popup window)

thathi commented 3 years ago

@smallteam1 I believe that is something to do with this discussion #1089

3dmundbarton commented 3 years ago

@smallteam1 - can you raise this on a new ticket please - this issue is unlikely to do with the Command Bar (this issue), it is related to opening specific Dynamics App.

RahulB9940 commented 3 years ago

commandbar.clickcommand("New") still not working. It was working last thursday, facing this issue since this morning

badarmunirr commented 3 years ago

Updated to nugget package?

3dmundbarton commented 3 years ago

Can you cross check the following and if they match, then it could be an issue with the fix.

The version of easy repro controlled via nuget needs to match your version of Dynamics (which depends on the D365 agreement your org has with MS regarding patching and wave updates)

RahulB9940 commented 3 years ago

Thanks click command issue is fixed now but getting index out of range exception on grid.getgriditems(). I see a issue raised but was it published on to nugget ?? Please let me know on this

tpalus commented 3 years ago

@3dmundbarton, I know it is not question for this subject, but Are tests works properly for you? e.g. login and click on app(without mfa)