Question
CR England
US
Last activity: 6 Sep 2018 2:26 EDT
Pega OpenSpan Studio Interrogate Unordered List
I have been running into some trouble when interrogating an unordered list on a web page. After I create the controls for the different elements, I refresh the web page and the controls will get jumbled up and attach themselves to the wrong elements. There isn't a way to uniquely identify each item. Is there any way to fix this? The uploaded images help demonstrate the issue.
***Edited by Moderator Marissa to update categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
IKOR PX
AU
I see what you say. Those tags are not uniquely identifiable. But try this.. to extract Directed By value
<li class="meta-row clearfix">
<div class="meta-label subtle">Directed By: </div>
<div class="meta-value">
<a href="/celebrity/ron_howard">Ron Howard</a>
</div>
</li>
First identify the control <li class="meta-row...."> as container. Then match the "Directed By:" div using text match. Then use children match rule on the container and select "Directed By:" div. Then within that container, you can match for the anchor without any additional match rules (except the default element type match rule)..
OR
Try OCR
https://docs-previous.pega.com/creating-automations-using-screen-ocr-feature
Give it a try and let me know how it goes.
IKOR PX
AU
Its perhaps the match rules. We need more info on what you are trying to match and how are you trying to match them. You would have to fine tune the match rules until you got the unique match. From the screenshot, if seems like the match rules you have used to identify the controls are not sufficient [see how they are returning multiple matches]. Try adding more match rules based on available HTML node information to uniquely identify a node.
CR England
US
<div class="panel-body content_body">
<div id="movieSynopsis" class="movie_synopsis clamp clamp-6" style="clear:both">
Board the Millennium Falcon and journey to a galaxy far, far away in Solo: A Star Wars Story, an all-new adventure with the most beloved scoundrel in the galaxy.
<div class="panel-body content_body">
<div id="movieSynopsis" class="movie_synopsis clamp clamp-6" style="clear:both">
Board the Millennium Falcon and journey to a galaxy far, far away in Solo: A Star Wars Story, an all-new adventure with the most beloved scoundrel in the galaxy. Through a series of daring escapades deep within a dark and dangerous criminal underworld, Han Solo meets his mighty future copilot Chewbacca and encounters the notorious gambler Lando Calrissian, in a journey that will set the course of one of the Star Wars saga's most unlikely heroes.</div>
<ul class="content-meta info">
<li class="meta-row clearfix">
<div class="meta-label subtle">Rating: </div>
<div class="meta-value">PG-13 (for sequences of sci-fi action/violence)</div>
</li>
<li class="meta-row clearfix">
<div class="meta-label subtle">Genre: </div>
<div class="meta-value">
<a href="/browse/opening/?genres=1">
Action & Adventure</a>, <a href="/browse/opening/?genres=9">
Drama</a>, <a href="/browse/opening/?genres=14">
Science Fiction & Fantasy</a></div>
</li>
<li class="meta-row clearfix">
<div class="meta-label subtle">Directed By: </div>
<div class="meta-value">
<a href="/celebrity/ron_howard">Ron Howard</a></div>
</li>
<li class="meta-row clearfix">
<div class="meta-label subtle">Written By: </div>
<div class="meta-value">
<a href="/celebrity/lawrence_kasdan">Lawrence Kasdan</a>, <a href="/celebrity/jon_kasdan">Jon Kasdan</a></div>
</li>
<li class="meta-row clearfix js-theater-release-dates">
<div class="meta-label subtle">In Theaters: </div>
<div class="meta-value">
<time datetime="2018-05-24T17:00:00-07:00">May 25, 2018</time>
<span style="text-transform:capitalize"> wide</span>
</div>
</li>
<li class="meta-row clearfix">
<div class="meta-label subtle">Studio: </div>
<div class="meta-value">
<a href="http://www.starwars.com/films/solo" target="movie-studio">Walt Disney Pictures</a>
</div>
</li></ul>
</div>
This is the HTML for what I am trying to interrogate. I'm trying to uniquely identify the rating and the in theaters data. On some pages there is a runtime as well. The website that I am interrogating is rotten tomatoes. https://www.rottentomatoes.com/m/solo_a_star_wars_story
Accepted Solution
IKOR PX
AU
I see what you say. Those tags are not uniquely identifiable. But try this.. to extract Directed By value
<li class="meta-row clearfix">
<div class="meta-label subtle">Directed By: </div>
<div class="meta-value">
<a href="/celebrity/ron_howard">Ron Howard</a>
</div>
</li>
First identify the control <li class="meta-row...."> as container. Then match the "Directed By:" div using text match. Then use children match rule on the container and select "Directed By:" div. Then within that container, you can match for the anchor without any additional match rules (except the default element type match rule)..
OR
Try OCR
https://docs-previous.pega.com/creating-automations-using-screen-ocr-feature
Give it a try and let me know how it goes.
CR England
US
Thank you! You have been very helpful!
Cognizant
IN
Hi,?
Can you please share how to get the list of items from the ordered list which is all hyper link and based on the input need to perform the click method for specified ink?
Any sample will he helpful.
Thanks,
Vadivel M
IKOR PX
AU