microsoft / EasyRepro

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

Click on Ribbon button in Subgrid #1162

Open PawelWas1985 opened 3 years ago

PawelWas1985 commented 3 years ago

Please Help!!! Does any of you know how to click in this button:

img

shariquekhan1997 commented 3 years ago

Workaround: Try using XPath to reach there. You may also check this blog. 👍

PawelWas1985 commented 3 years ago

Hi @shariquekhan1997 thanks for response :) i will try to use your solution but i wonder how to locate the "options" within this button because in the DOM structure i can not see them even if i clicked manually on this button

shariquekhan1997 commented 3 years ago

Hi @shariquekhan1997 thanks for the response :) I will try to use your solution but I wonder how to locate the "options" within this button because in the DOM structure I can not see them even if I clicked manually on this button

There is a trick for this, go in dev tools > Console tab > $x('Xpath of button you want to click in a single quote').click()

The above line will click that button and your dropdown will be visible with the dev tools intact in its place. Now you can inspect and hover on the target dropdown.

PawelWas1985 commented 3 years ago

hmmm....maybe i made some mistake but i've got something like this: img1

shariquekhan1997 commented 3 years ago

hmmm....maybe i made some mistake but i've got something like this: img1

Try adding [0] in $x('Xpath of button you want to click in a single quote')[0].click() as it is a array of elements.

TYLEROL commented 3 years ago

@PawelWas1985 - This depends on if the grid is truly a "subgrid" on a form, or if it's considered a "related grid".

The commands to call them will vary slightly. Calling ClickCommand() should be the same between them.

Edit: This should be a traditional subgrid based on your original screenshot

xrmApp.Entity.Subgrid.ClickCommand();

vs

xrmApp.RelatedGrid.ClickCommand();

PawelWas1985 commented 3 years ago

Hi @TYLEROL i used this one: xrmApp.Entity.Subgrid.ClickCommand(); but unfortunately received NoSuchElementException : OpenQA.Selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@id="dataSetRoot_Progress Candidates"]"} 2021-07-29_11h36_44 any ideas how to handle with this? This is the DOM: 2021-07-29_12h54_21 Anyway i made the changes in AppElementReference.cs: was: { "Related_CommandBarButtonList" ,"//ul[contains(@data-lp-id, 'commandbar-SubGridAssociated')]"}, is: { "Related_CommandBarButtonList" ,"//ul[contains(@data-lp-id, 'commandbar-SubGrid')]"},

Now it looks that is work fine but i hope this won't cause problems with other tests. what is your opinion?

kchinmay07 commented 5 months ago

Hi Guys i need help

i am not aware of the command/Syntax, as i am new to EasyRepro

My question is

please refer screenshot

image

1.i am Using below command for searching a particular record xrmApp.Grid.search("Adventure work Electronics"); Now in front of me i have only 1 record

once this record is in front of me 2.i want to click on the 305-555-0118 main phone(highlighted in yellow), as after clicking on the main phone only, user can see the service request generated under.

can you please help me, which command i need to use, in order to click on 305-555-0118 main phone.

shariquekhan1997 commented 3 months ago

The main phone is clickable like the Account Name? or it is just text? and click on that would select the record. Correct me if I am wrong here.