I have a situation where I have discoverd that the developer of a specific web application I have automation running against appears to have a element attribute issue.
This goes to the topic of looking for when a string is shown on-screen and when it is not-on-screen. To show the structure and showing element parent/child/peer relationships, here is a snap of Chrome inspect results:
The red lines on left shows the primary parent elements and and child-but-peers elements. Note that all three elements using a “style” attribute to control when something is display or not … mostly that is. The blue lines are showing the “style” attribute which is the on-screen vs not-on-screen control mechanism.
QUESTION: I’m looking to see if there is a some selector syntax magic that works with “Element Exists” where I can query both a parent and two at-the-same-level child elements within the same query.
EXPLANTION of the issue … rather tedious … my apologies.
I have found that the “spinnerContent” div does not maintain its style attribute consistently. After a bit of Chrome Inspect analysis I found the following. I have the parent and children indented below . This is showing what the “style” attributes have when something is on-screen vs not-on-screen (meaning block vs none as the style values). The indentation of textContext and spinnerContent lines shows they are peers and children of the bigMessage DIV.
(hopefully this makes sense)
bigMessage = block
… textContent = none
… spinnerContent = block
*** Above means that likely “Loading Data…” message is being displayed … but this is a guess at best. “Loading Failed” could also be being displayed.
bigMessages = none
… textContent = none
… spinnerContent = block (this is the part that does not makes sense … this should be none … not block)
*** “Loading Data…” is definitely not being displayed
bigMessages = block
… textContent = block
… spinnerContent = none (now this has the correct style setting !!!)
*** “No Items to Display” is on screen
I’m essentially looking for when the string “Loading Data…” is on-screen and I wait for it disappear. If I use only the bigMessage style selector is basically works. However, there is a collision for the situation where “No Items to Display” is on screen because of the inconsistent using of the style attribute on the spinnerContent element.
Hoping someone knows of some magic peer selector syntax that came used with Element Exists.