microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
512 stars 285 forks source link

How to click on the phone (subgrid record header) phone number #1415

Open kchinmay07 opened 2 months ago

kchinmay07 commented 2 months ago

Question

What is your question? phone

after successful login Dynamics 365 i searched a particular record using xrmApp.Grid.Search("datum") and now i want to click on "Main phone" that is 425-555-0158,

which command i should use, can someone please help.

Shakevg commented 2 months ago

kchinmay07 This is no such method, but you can implement it:

 public void ClickCell(int rowIndex, int columnIndex)
 {
     var gridContainerXPath = AppElements.Xpath[AppReference.Grid.Container];
     var cellXpath = gridContainerXPath + "//*[@row-index='{0}']//*[@aria-colindex='{1}']";
     var cellLocator = By.XPath(string.Format(cellXpath, rowIndex, columnIndex);
     var cell = GridContainer.Control.WaitUntilAvailable(cellLocator),
         $"An error occurs trying to get control on the record {rowIndex} and cell at position {columnIndex}");
     cell.Click();
     Driver.WaitForTransaction();
 }

Where rowIndex and columnIndex indexes from 0.

kchinmay07 commented 2 months ago

i am using EASYREPRO FRAMEWORK, visual studio

image

Once i search datum, in front of me only 1 record is visible

and now i want to click on main phone only( as service request is generated under this only.)

Shakevg commented 2 months ago

kchinmay07 As I answered Framework doesn't contain such a feature, you can implement locally or contribute and add such functionality

kchinmay07 commented 2 months ago

can you write the full command

krishnacs1993 commented 1 month ago

@kchinmay07 as @Shakevg answered, there is no command in EasyRepro to click on the phone number you are highlighting in the screenshot. You need to write code in Selenium and C# to handle this behavior. You can use the code provided by @Shakevg .