microsoft / EasyRepro

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

[BUG] Facing issue with xrmApp.Grid.OpenRecord(0); in Headless Mode #1267

Open dgowshik opened 2 years ago

dgowshik commented 2 years ago

Bug Report

While running the automation scripts in Headless mode, I am facing the issue in this method "xrmApp.Grid.OpenRecord(0);" instead of opening the first record from the grid, it is trying to open the third column record or hyperlink associated to the first record row.

EasyRepro Version

UCI or Classic Web

Browser

Describe the bug
Suppose, there is a record in a grid which is having 5 columns. The first column has the actual record label or hyperlink to be opened while using xrmApp.Grid.OpenRecord(0); method. But, this method tries to open the record by clicking the third column label or hyperlink which is associated to the different entity and record.

Code to reproduce

Mode - Headless

xrmApp.Grid.OpenRecord(0);

Expected behavior
It should open the record from the grid which shows in the first column.

JakeObrienMercuryXrm commented 2 years ago

Hey, I have the same issue as above but whilst running it non-headless too!

Sekhon92 commented 2 years ago

Any luck with this one guys?

tipsey commented 1 year ago

2022 release wave 2 enabled Server version: 9.2.22093.00184 Client version: 1.4.4799-2209.3

EasyRepro-alyousse-develop-2022ReleaseWave2

Getting problem now either headless or not now.

Message: Test method Sanity.SanityTests.MyTest threw exception: System.InvalidOperationException: Sequence contains no elements

Stack Trace: BrowserCommand1.Execute[T1,T2,T3,T4,T5,T6,T7,T8,T9](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) line 138 BrowserCommand1.Execute(IWebDriver driver) line 35 BrowserPage.Execute[TResult](BrowserCommandOptions options, Func`2 delegate) line 182 WebClient.OpenRecord(Int32 index, Int32 thinkTime, Boolean checkRecord) line 1543 Grid.OpenRecord(Int32 index) line 39

chandramohand commented 1 year ago

Hi All, Is this issue got resolved? Even I am using the latest version or pre-release version still throws error.
Please update if any solution for this. Thanks and Regards, Chandra.

chandramohand commented 1 year ago

Hi, Is this issue resolved?
Thanks in Advance, Chandra.

JakeObrienMercuryXrm commented 1 year ago

Nope, still not fixed. Had to change everywhere in my project that uses OpenGridRow to look for a specific aria-label or title in the of the grid rows. This has been broken for some time now and is used pretty much everywhere! I use an xpath expression similar to the following:

Driver.FindElement(By.Xpath("//a[@title = 'element' | //a[@aria-label = 'element']").Click();

@chandramohand

chandramohand commented 1 year ago

Thanks @JakeObrienMercuryXrm, me too facing the same problem and the same way I am finding the unique record and clicking on that web element.

Thanks, Chandra.