mfoster711
10 years agoRegular Contributor
Empty Span Elements
I am having an issue with empty span elements. I know span elements are not mapped unless they have text or a role.
I am curious if anybody has a suggestion on how to handle my situation. Here is what my section looks like:
<div class="blah blah blah">
<span class="twoLines displayGroup"><label>VIN</label><span class="value">2FMxxxxxxxxxxxxxx</span></span>
<span class="twoLines displayGroup"><label>Exterior Color</label><span class="value"></span></span>
<span class="twoLines displayGroup"><label>Deal Type</label><span class="value">Retail</span></span>
<span class="twoLines displayGroup"><label>Vehicle Category</label><span class="value">Sedan</span></span>
<span class="twoLines displayGroup"><label>Interior Color</label><span class="value"></span></span>
<span class="twoLines displayGroup"><label>Stock Type</label><span class="value">New</span></span>
<span class="twoLines displayGroup"><label>Style</label><span class="value">4dr SEL FWD</span></span>
<span class="twoLines displayGroup"><label>License Plate #</label><span class="value">GYNASD</span></span>
<span class="twoLines displayGroup"><label>Extended Warranty</label><span class="value"></span></span>
<span class="twoLines displayGroup"><label>Mileage</label><span class="value">10,700</span></span>
<span class="twoLines displayGroup"><label>License Plate Exp Date</label><span class="value"></span></span>
</div>
The problem I have is that the value spans may or may not contain a value. For example, "Exterior Color" is an optional value the use may not have entered. Well, if the value is not entered then TestComplete does not map it. This causes all the TextNodes to shift down one. Where Vehicle Category was TextNode 3 it is not TextNode 2.
How can I check the TextNode values if the number of TextNodes that displays varies depending on whether the user entered information or not?
Alternatively, is there some way to "Find" the correct span based on the Label next to it?
Lastly, Is there a logical reason whey TestComplete does not map empty span elements? Or, is this just flaw with TestComplete that SmartBear does not consider worth the time to fix since nobody complains about it?
I am curious if anybody has a suggestion on how to handle my situation. Here is what my section looks like:
<div class="blah blah blah">
<span class="twoLines displayGroup"><label>VIN</label><span class="value">2FMxxxxxxxxxxxxxx</span></span>
<span class="twoLines displayGroup"><label>Exterior Color</label><span class="value"></span></span>
<span class="twoLines displayGroup"><label>Deal Type</label><span class="value">Retail</span></span>
<span class="twoLines displayGroup"><label>Vehicle Category</label><span class="value">Sedan</span></span>
<span class="twoLines displayGroup"><label>Interior Color</label><span class="value"></span></span>
<span class="twoLines displayGroup"><label>Stock Type</label><span class="value">New</span></span>
<span class="twoLines displayGroup"><label>Style</label><span class="value">4dr SEL FWD</span></span>
<span class="twoLines displayGroup"><label>License Plate #</label><span class="value">GYNASD</span></span>
<span class="twoLines displayGroup"><label>Extended Warranty</label><span class="value"></span></span>
<span class="twoLines displayGroup"><label>Mileage</label><span class="value">10,700</span></span>
<span class="twoLines displayGroup"><label>License Plate Exp Date</label><span class="value"></span></span>
</div>
The problem I have is that the value spans may or may not contain a value. For example, "Exterior Color" is an optional value the use may not have entered. Well, if the value is not entered then TestComplete does not map it. This causes all the TextNodes to shift down one. Where Vehicle Category was TextNode 3 it is not TextNode 2.
How can I check the TextNode values if the number of TextNodes that displays varies depending on whether the user entered information or not?
Alternatively, is there some way to "Find" the correct span based on the Label next to it?
Lastly, Is there a logical reason whey TestComplete does not map empty span elements? Or, is this just flaw with TestComplete that SmartBear does not consider worth the time to fix since nobody complains about it?