Open jaziriferes1 opened 2 years ago
Should be fixed in develop-2021ReleaseWave2 branch. See #1206. There hasn't been a wave 2 NuGet version released yet.
I also experience an issue with Grid.OpenRecord(0) in the latest version of branch develop-2021ReleaseWave2. It seems that the linked ticket doesn't fix the issue completely. Error message is Unable to locate element: {"method":"xpath","selector":"//div[@ref='eViewport']"}
The test Microsoft.Dynamics365.UIAutomation.Sample.UCI.Grid.UCIGridOpenRecord() fails when OpenRecord(0) is called:
BrowserAutomation Information: 10004 : Command Retry: Open Grid Record - OpenQA.Selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@ref='eViewport']"}
(Session info: chrome=95.0.4638.69) - Retry 5/5 initiated
BrowserAutomation Information: 10003 : Command Failure: Open Grid Record - 5 attempts - total execution time 20102,5376ms - Return Result: OpenQA.Selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@ref='eViewport']"}
(Session info: chrome=95.0.4638.69)
bei OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
bei OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
bei OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
bei OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByXPath(String xpath)
bei OpenQA.Selenium.By.<>c__DisplayClass19_0.<XPath>b__0(ISearchContext context)
bei OpenQA.Selenium.By.FindElement(ISearchContext context)
bei OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by)
bei Microsoft.Dynamics365.UIAutomation.Api.UCI.WebClient.<>c__DisplayClass77_0.<OpenRecord>b__0(IWebDriver driver) in C:\Users\...\crm\EasyRepro\Microsoft.Dynamics365.UIAutomation.Api.UCI\WebClient.cs:Zeile 1544.
bei Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand`1.ExecuteCommand(IWebDriver driver, Object[] params) in C:\Users\...\crm\EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\DelegateBrowserCommand.cs:Zeile 28.
bei Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand`1.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) in C:\Users\...\crm\EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:Zeile 103.
Hi @jkanschik ,
Let me take a look at this one shortly and confirm if I can reproduce on my end.
Thanks! Ali
Hi @jkanschik ,
Let me take a look at this one shortly and confirm if I can reproduce on my end.
Thanks! Ali
I am unable to reproduce this in two environments I have for testing. Can you confirm the build version of the environment you're using?
I'm sure we're also using this method successfully - @jkanschik is it a standard read-only grid or is it an editable grid?
Actually, I just realized that for Opportunities and also some other entities, OpenRecord() works perfectly. At least for my current environment, the UI for Accounts and Opportunities are actually different. Completely different HTML / CSS.
Do you have the same grids for Sales Hub => Account and Sales Hub => Opportunities?
I'm on 2021 Release Wave 2, Database version 9.2.21102.00131
In Sales Hub, these are the two mentioned lists; as you can see, the UI is different:
List of opportunities:
List of accounts:
@jkanschik haven't checked but the accounts grid there looks like an editable grid. The 'Group By' is present on editable grids, at least, and I don't believe they got updated in wave 2. The logic for opening records was probably quite similar for editable grids and read-only grids before so it may have actually worked in the past despite the grids different and there not being any obvious code path for it.
Am seeing this issue in version 9.2.22083.00150 is there a work around
int row = 0; xrmApp.Grid.OpenRecord(row);
Message: input cannot be null (Parameter 'input')
Source: Microsoft.Dynamics365.UIAutomation.Browser
Stack Trace: at Microsoft.Dynamics365.UIAutomation.Browser.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) at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand
1.Execute(IWebDriver driver) at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult](BrowserCommandOptions options, Func2 delegate) at Microsoft.Dynamics365.UIAutomation.Api.UCI.WebClient.OpenRecord(Int32 index, Int32 thinkTime, Boolean checkRecord) at Microsoft.Dynamics365.UIAutomation.Api.UCI.Grid.OpenRecord(Int32 index) at GenericFramework.StepD365.GridOpenRecord(Target TargetElement, String data) in C:\Users\sesiho\Source\Repos\BANNER-Test\SLP-SMOKE\GenericFramework\StepD365.cs:line 70 at GenericFramework.Testcase.Steps(String action, String target, String data, String[] rowdata) in C:\Users\sesiho\Source\Repos\BANNER-Test\SLP-SMOKE\GenericFramework\Testcase.cs:line 611 at GenericFramework.Testcase.Execute(String tc, IDictionary
2 _vars, IDictionary2 _datalookup, String[] _rowdata, IDictionary
2 _reports, List`1 _dataoutput) in C:\Users\sesiho\Source\Repos\BANNER-Test\SLP-SMOKE\GenericFramework\Testcase.cs:line 511
I am also getting issue on xrmApp.Grid.OpenRecord(0); 2022 release wave 2 enabled Server version: 9.2.22103.00172
OpenQA.Selenium.NoSuchElementException: No records were found in the grid.
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 BrowserCommand
1.Execute(IWebDriver driver) line 35
BrowserPage.Execute[TResult](BrowserCommandOptions options, Func`2 delegate) line 182
WebClient.OpenRecord(Int32 index, Int32 thinkTime, Boolean checkRecord) line 1535
Grid.OpenRecord(Int32 index) line 32
I have an ugly hack:
//xrmApp.Grid.OpenRecord(0);
xrmApp.ThinkTime(3000);
var x = client.Browser.Driver.FindElements(By.XPath("//*[contains(@class,'ms-Check-check') and contains(text(),'')]"));
x[0].Click(); //Selects all radio row selectors
x[1].Click();
x[0].Click();
x[0].Click();
xrmApp.ThinkTime(5000);
x[1].Click(); //Selects first row by clicking on radio button on that row
xrmApp.CommandBar.ClickCommand("Edit");
The EasyRepro-wave2-fix-patch-1.zip contains a fix but there were too many other things broken in that patch.
Anyone else getting success / workarounds?
I think I found a solution by implementing a fix from ReleaseWave2 patch 1. It worked for me
https://github.com/microsoft/EasyRepro/pull/1186/commits/27ee5a91936b8d2fd75d6b342a904f31ab40ad42
WebClient.cs
internal BrowserCommandResult
Func<Actions, Actions> action;
if (checkRecord)
action = e => e.Click();
else
action = e => e.DoubleClick();
var xpathToCell = By.XPath($".//div[@role='rowgroup']/div[@row-index={index}]");
control.WaitUntilClickable(xpathToCell,
cell =>
{
var emptyDiv = cell.FindElement(By.TagName("div"));
driver.Perform(action, cell, cell.LeftTo(emptyDiv));
},
$"An error occur trying to open the record at position {index}"
);
driver.WaitForTransaction();
return true;
});
}
///
var headerTitleName = headerTitle?.GetAttribute("title");
if (string.IsNullOrEmpty(headerTitleName))
{
throw new NotFoundException("Unable to retrieve Header Title for this entity");
}
return headerTitleName;
});
}
Microsoft.Dynamics365.UIAutomation.Api.UCI/DTO/AppElementReference.cs
//Grid { "Grid_Container" , "//div[@role=\"grid\"]"}, { "Grid_QuickFind" , "//*[contains(@id, \'quickFind_text\')]"}, { "Grid_NextPage" , "//button[contains(@data-id,'moveToNextPage')]"},
Hello, i have this issue while delete a Lead it gives out an error indicating it cannot find the element. Is it xpath issue ? i tried using the xpath inspecting the browser but did not find a match, so i tried my own xpath and still got the same error. Can you plz help me out on this.... thankyou [my xpath: //div[@Class='ms-StackItem truncatableText-409']] Message: Test method Microsoft.Dynamics365.UIAutomation.Sample.UCI.UpdateLeadUCI.UCITestUpdateActiveLead threw exception: OpenQA.Selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@tabindex='0' and https://github.com/ROLE='checkbox']"} (Session info: MicrosoftEdge=123.0.2420.53)
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 140 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 1535
Grid.OpenRecord(Int32 index) line 32
UpdateLeadUCI.UCITestUpdateActiveLead() line 35
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
Special formatting / display
Code to reproduce
Expected behavior
Screenshots
Additional context