cancel
Showing results for 
Search instead for 
Did you mean: 

Checkbox on Mapquest Site

diane.sanzone
Level 7
We are working on an object to interface with the Mapquest site (https://www.mapquest.com/routeplanner) and struggling with the checkboxes for the "Let us re-order stops" and "Round trip".  We've tried spying with both browser and UIA (through Chrome) but cannot identify the proper attribute/element to be able to determine if the box is checked or unchecked. We can spy the element correctly and even interact with it, but we can't tell if it's checked.  Every reader stage we attempt returns blank for the attribute values whether the box is checked or unchecked, so either we have the wrong element spied or are looking at the wrong attribute.

I appreciate any suggestions you might have.

------------------------------
Diane Sanzone
------------------------------
1 BEST ANSWER

Helpful Answers

@Diane Sanzone

I believe you are going to have to use Region Mode (which I have never used) for that one​ because the page is using a CSS Selector to display the checkmark inside the SPAN element. 



------------------------------
Micheal Charron
Senior Manager
RBC
America/Toronto
------------------------------
Micheal Charron
RBC
Toronto, Ontario
Canada

View answer in original post

8 REPLIES 8

EmersonF
MVP

Hi Diane, fine? So, You can post here the Screenshot of Element? and how do you try get this information in read action



------------------------------
Emerson Ferreira
Cons, Intelligent automation
Avanade Brasil
Recife
+5581988869544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

Hi Emerson,

Here are the elements we're working with.  We tried spying them a few ways and then using the reader stage on the Web Value, I believe.  Our goal is to be able to determine if the box is checked or unchecked so we can then have the bot check or uncheck as needed.  If you have any ideas on how to configure these I'd value your input.
25694.png


------------------------------
Diane Sanzone
------------------------------

@Diane Sanzone

I believe you are going to have to use Region Mode (which I have never used) for that one​ because the page is using a CSS Selector to display the checkmark inside the SPAN element. 



------------------------------
Micheal Charron
Senior Manager
RBC
America/Toronto
------------------------------
Micheal Charron
RBC
Toronto, Ontario
Canada

Would you be able to post the screenshot of the attributes of how it was mapped?

See if this also helps, I found on the web.

Blue Prism provides no facility to return data directly from a JavaScript call back into the calling Object. Your best bet is to use a script that generates a hidden element in the DOM and appends the data you want to exfiltrate:input

var hiddenElement = document.querySelector('#bp-output');
if (typeof hiddenElement === 'undefined') {
    hiddenElement = document.createElement('input');
    hiddenElement.type = 'hidden';
    hiddenElement.id = 'bp-output';
    document.body.appendChild(hiddenElement);
}
hiddenElement.value = /* some functionality to set the value of the newly-created hidden element */;
You'll need to model this element in your object's application modeler, but it's fairly simple to do - you don't need to match on any attributes other than "ID" or "Web ID", and it's a match only to the string .bp-output

From there, you can use a typical Read stage to read the value out of the attribute of your element.value

For more complex data structures like Collections, you will have to utilize some serialization trickery to get to where you want to be. For example, if you're trying to read a table into a Collection via JavaScript, your in the example above may need to leverage some code from this SO thread to serialize the table itself to a CSV string. Once you've read the string from the hidden element's , you could use the CSV-related actions in the vendor-provided VBO to serialize this to a proper Collection for your use in your Objects/Processes./* functionality to set the value of the newly-created hidden element */valueUtility - Strings


------------------------------
Emerson Ferreira
Cons, Intelligent automation
Avanade Brasil
Recife
+5581988869544
If my answer helped you? Mark as useful!
------------------------------

Sr Cons at Avanade Brazil

Thanks, Emerson.  My team has little to no experience with JavaScript and I have no time to learn it now.  We realized that the checkbox resets on page load, so we're just going to close and relaunch the site each time we need it. The bot is otherwise quite fast so it can take the performance hit.  If it ever becomes an issue we can try some more complicated fixes or even jump to Michael's surface automation suggestion (that's what I was saying internally but everyone groaned at the thought).

Appreciate the help!

------------------------------
Diane Sanzone
------------------------------

Hi Diane,
I was able to spy in Browser mode with below attributes.
1. Spy the Box with the following attributes: 25709.pngWeb Path - //input[@data-cy='round-trip']Web Element Type - checkbox
And make sure to set Element type as "Check Box (Web)"


2.Now you can use read stage to get current state :
25710.png
Similarly you can modify xpath to get other checkbox values:
25711.png


------------------------------
Pashupati Mishra
------------------------------
Pashupati Mishra EY @malikmishra2004@gmail.com

Thank you, Pashupati, for the detailed response.  This looks amazing and seems to be exactly what we needed. Unfortunately this effort has been pushed down in priority so I won't be able to test it for a while, but I promise I will and will update here whether or not it worked for us.

Thank you so much for taking the time.  I appreciate it more than you could possibly imagine.

------------------------------
Diane Sanzone
------------------------------

Glad to help Diane.​

------------------------------
Pashupati Mishra
EY
@malikmishra2004@gmail.com
------------------------------
Pashupati Mishra EY @malikmishra2004@gmail.com