cancel
Showing results for 
Search instead for 
Did you mean: 

How to spy a dropdown on a Web Browser using BluePrism?

I am a beginner RPA Developer, and the RPA Software that my company uses is BluePrism. Now, I have this project (actually my first project ever) that needs to interact with an in-house Application, and it has a lot of dropdown entries, where you can only select or click the options, not allowed to type anything. I got stalled on spying that dropdown and thinking how do I select the correct option inside that dropdown.

I have tried everything that our trainer have taught us, but I still can't get it working.

--------------------------------------------------
Disclaimer: This content was auto-posted from Stackoverflow. The original Stackoverflow question is here Stackoverflow Post, posted by Rdee Cruz.
Hi  I am a Digital Worker. Please check out my profile to learn more about what I do!
1 BEST ANSWER

Helpful Answers

Spy the drop-down as you normally would with Application Modeller (click Identify, Ctrl+Click the drop-down). The drop-down should be identified as an HTML Combo Box. Here is what my Application Modeller looks like when I spy the drop-down item on http://hist.io, a useful page for experimenting with HTML webpages:

8139.png


Then drag a Navigate stage into your Object's action. Pull in the Combo Box element you spied above, and set the action to Select Item and set one of the Inputs. In my example below, I simply set Item Text to a value of Option Two, which is one of the available values to select from the Combo Box. When I run my action, this Navigate stage selects Option Two from the Combo Box.

8140.png
Cheers.


------------------------------
Charles Kovacs
Developer Consultant
Blue Prism
America/Chicago
------------------------------
Charlie Kovacs

View answer in original post

9 REPLIES 9

Spy the drop-down as you normally would with Application Modeller (click Identify, Ctrl+Click the drop-down). The drop-down should be identified as an HTML Combo Box. Here is what my Application Modeller looks like when I spy the drop-down item on http://hist.io, a useful page for experimenting with HTML webpages:

8139.png


Then drag a Navigate stage into your Object's action. Pull in the Combo Box element you spied above, and set the action to Select Item and set one of the Inputs. In my example below, I simply set Item Text to a value of Option Two, which is one of the available values to select from the Combo Box. When I run my action, this Navigate stage selects Option Two from the Combo Box.

8140.png
Cheers.


------------------------------
Charles Kovacs
Developer Consultant
Blue Prism
America/Chicago
------------------------------
Charlie Kovacs

Hi Charles,
I am doing one POC on Currency Exchange website. It written in java script. 

I have an issue with FromCurrency and ToCurrency drop down list . 
8146.png
It has hidden input element. I came to know while inspecting the code of From Currency :  <input name="From" type="hidden" value="USD">

I am trying to set the value of FromCurrency using data item to AED but value is not reflecting in it.


------------------------------
Kamlesh Khollam
------------------------------

Kamlesh,

Since it is hidden, you will probably need to inject some JavaScript to change that value from "USD" to something else. I'm not sure if this exact approach will work for this particular web page, but here's a general approach to try:

1. In Application Modeller, spy the whole web page (not a specific element on the page, but the entirety of the page). You may need to play around with the different spy modes to get this to work. In my example, I have an element named Body. You can see the Web Path attribute for this element is capturing the whole HTML/BODY content. When I click Highlight, I get a rectangle drawn around the entire web page (and not a specific element). This Body element is used to inject JavaScript into the page in the next step.

8151.png


2. On an Action page in your VBO, you need two Data Items to hold JavaScript code and one Navigate stage (to inject the JavaScript from the Data Items). I have one Data Item named Function which will contain a JavaScript function to update the value of an HTML element named From. I have a second Data Item named Call which will call the function defined in the first Data Item.

Function Data Item Value:
function updateFromValue() { document.getElementsByName('From')[0].value = 'new value here'; }

Call Data Item Value:
updateFromValue();

In your Navigate Stage, create two rows, drag in the Body element (from Step 1) into both rows and set the Action to Insert Javascript Fragment. In the first row, add the Function data item. In the second row, add the Call data item.

A couple of caveats:
1. For the Function data item, you'll need to implement some logic to determine what value should be entered. I just put 'new value here' as a placeholder example.
2. This example assumes there is only one HTML element on your page with a name of From. Check out the getElementsByName() function for more detail on that: https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByName

8154.png
I can't say this approach will work for every web page, but start there and see how it goes.

Cheers

------------------------------
Charles Kovacs
Developer Consultant
Blue Prism
America/Chicago
------------------------------
Charlie Kovacs

Charles

I was facing the same problem as stated by Kamlesh and I try to spy whole web page but scanned element has path as HTML only and as HTML element.
I am stuck here and unable to proceed.

------------------------------
Lalita Gangwani
------------------------------

Lalita,

I have my Application Modeller set up to launch Internet Explorer and navigate to http://histo.io (for testing HTML elements). In the Application Modeller, I then click Identify (down arrow) > Open Application Navigator. Then I can select the Body element.

8175.png



I have had troubles where I can't do this in Chrome. It might be possible, but I'm not sure how to do it.





------------------------------
Charles Kovacs
Developer Consultant
Blue Prism
America/Chicago
------------------------------
Charlie Kovacs

8186.pngHi,

I am trying to spy the drop down box in Servicenow. Since the drop down boxes are not all the same (refer attached image), I am unable to spy it appropriately, especially those drop down boxes in the left side of the image attached (which looks different from the drop down boxes on the right side)

I had tried different spying options.

I am able to spy it as a Hyperlink (UIA) element type and a combo box (UIA) element type.

In combo box (UIA) type, when i try to highlight, it is highlighting all the drop down boxes in the right side of the image

In hyperlink (UIA), nothing gets highlighted

My purpose is to open the drop down box using blueprism action in VBO and select an option from the drop down list.

I am stuck here for more than a week now. Rest of the process is completed.

Any help on this please?


------------------------------
Akshay Vembanattu
------------------------------

Hi Akshay,

Have you tried spying with different browsers to see if anything changes? Can you describe what exactly it is, within ServiceNow, that you're trying to do? There are some skills available on the DX that allow you to work with SerivceNow directly via their REST API instead of having to Spy via the UI. I'm wondering if any of those might work for you?

Cheers,

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

Hi,
I worked on this application, I was facing the same issue so as a solution I simply used "Global send keys" after clicking on the input field of from currency.
Create Three navigate stage
1) Navigate1 : To click on input field (Action : click) (spy element : fromcurrency) (refer 1st image)
2) Navigate2 : To set the input by using Global send keys (text : "AUD") (spy element : fromcurrency)
3) Navigate3 : To select the auto suggested value from the pane by using global send keys "{ENTER}"  (spy element : selectvalue)(refer 2nd image)
In this application spying an element is really important. Exclude all the page address values into the application modeller while spying this elements.  
I hope this answer is helpful to you.

------------------------------
Sheetal Chaudhari
------------------------------

Hi, I was working on this project and had hard time selecting values of FROM and TO dropdowns.
Solution:

1. Spy the whole box as shown in browser mode
8210.png
2. Spy just the country name as shown in the image in browser mode and set web text as dynamic in application modeller
8211.png
3. Check element application modeller properties spied in Step 2. Copy web text value shown there and store it in some data item.
4. Introduce three stages as shown below to select a specific country,
8212.png 
a) Click From Button uses element spied in Step 1 and select click using navigate stage.
b) Write Country Name uses element spied in Step 1 and writes the country name stored in data item in Step 3.
c) Click Country Name uses element spied in Step 2 and passes dynamic parameter with the name of the company stored in data item in Step 3.

Do the same for selecting To dropdown.

It should be working when you use it in Google Chrome.
Thanks.




------------------------------
Amritpal Singh Bhullar
------------------------------