Digital Exchange

Expand all | Collapse all

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

Jump to Best Answer
  • 1.  How to spy a dropdown on a Web Browser using BluePrism?

    Posted 09-07-2019 07:01

    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.


  • 2.  RE: How to spy a dropdown on a Web Browser using BluePrism?
    Best Answer

    Posted 09-18-2019 13:17
    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:

    Application Modeller


    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.

    Navigate Stage
    Cheers.


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



  • 3.  RE: How to spy a dropdown on a Web Browser using BluePrism?

    Posted 04-16-2020 08:40
    Edited by Kamlesh Khollam 04-16-2020 08:44
    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 . 
    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
    ------------------------------



  • 4.  RE: How to spy a dropdown on a Web Browser using BluePrism?

    Posted 04-16-2020 10:58
    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.




    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

    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
    ------------------------------



  • 5.  RE: How to spy a dropdown on a Web Browser using BluePrism?

    Posted 04-19-2020 07:33
      |   view attached
    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
    ------------------------------



  • 6.  RE: How to spy a dropdown on a Web Browser using BluePrism?

    Posted 05-06-2020 12:52

    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.

    application navigator



    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
    ------------------------------



  • 7.  RE: How to spy a dropdown on a Web Browser using BluePrism?

    Posted 06-10-2020 01:04
    Servicenow drop down boxHi,

    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
    ------------------------------



  • 8.  RE: How to spy a dropdown on a Web Browser using BluePrism?

    Posted 06-11-2020 13:49
    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
    ------------------------------