Automating the testing of several similar page elements with different content

Ranorex Spy, Recorder, and Studio.
sdrx
Posts: 1
Joined: Tue Jan 29, 2019 10:15 am

Automating the testing of several similar page elements with different content

Post by sdrx » Tue Jan 29, 2019 12:15 pm

This is quite an awkward one to explain so I'll upload a small diagram to hopefully simplify it but ultimately I think this is going to need a call with Ranorex to discuss in further detail.
usertypes.png
Roles
usertypes.png (12.53 KiB) Viewed 45 times
We have a screen that shows "cards" containing the types of users on the system, a brief description of each type of user and the number of users who fall in to that type.

The cards update frequently and can move around the page as user types are added/removed.

The type of user, description and number of assigned users is an easy SQL query to confirm (outside of Ranorex at the moment), however I would like to verify each card contains each of the values I expect for each user type.

When I update the path for one of the items to be as below, this shows the 3 cards under “col-md-4 mb-4”: /dom[@domain='example.com']//div[#'ngb-tab-1-panel']/div/div

Each “col-md-4 mb-4” has child items going down 5 levels until the title of the user type is visible as an h3 item.

The below path shows all the titles of each card.

/dom[@domain='example.com']//div[#'ngb-tab-1-panel']/div/div/?/?/div//h3

An example of the path to get to the description is below (removing the “[2]” and the “[@innertext=’This is the supervisor role’]” section in the path highlights all of the cards)
/dom[@domain='example.com']//div[#'ngb-tab-1-panel']/div/div[2]/?/?/div//div[@innertext=’This is the supervisor role’]

This is the full path for the number of users assigned:
/dom[@domain='example.com']//div[#'ngb-tab-1-panel']/div/div[1]//tag[@tagname='sd-card-body']/div/div[2]/span[@innertext='74']

This path below appears to be the way to have the Ranorex path browser highlight the number of users assigned to the user type for all the cards:
/dom[@domain='example.com']//div[#'ngb-tab-1-panel']/div/div/?/?/div//div/div//div//span

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4421
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Automating the testing of several similar page elements with different content

Post by odklizec » Wed Jan 30, 2019 8:46 am

Hi,

Please post a Ranorex snapshot of the problematic page. Screenshot is unfortunately useless for UI evaluation and without understanding the internal structure of UI, it's pretty hard to suggest something reliable. Thanks.

BTW, from your description, I did not understand what exactly do you want to achieve? You posted some xpaths and described difference between them, but what is to goal? ;) Please post also an short test/use case.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration