Robotic Process Automation (RPA)

 View Only
Expand all | Collapse all

Multiple Selection by class name

  • 1.  Multiple Selection by class name

    Posted Mon August 30, 2021 08:34 AM
    Hi , I want to use click on web page control, I have the control defined as a span with class attribute and no value attribute , how can I find all the attributes with specific class as there is no class name option only available in the click on web page. Using xpath is not applicable as It will be different each time 


    ------------------------------
    Rabee Nawash
    ------------------------------


  • 2.  RE: Multiple Selection by class name

    Posted Mon September 13, 2021 10:51 PM

    Hi Rabee, I recommend using the run javascript command with a one-liner to add a ID based on class name for you to interact with on the following line with Click on Web Page Command.

    Something like this

    (Using Linkedin as the example)

    <syntax-highlighted class="cm-s-mozilla">document.getElementsByClassName('feed-identity-module__member-photo profile-rail-card__member-photo EntityPhoto-circle-5 lazy-image ember-view')[0].setAttribute('id',"ClickMe");</syntax-highlighted>


    Here the class name is -> <syntax-highlighted class="cm-s-mozilla">feed-identity-module__member-photo profile-rail-card__member-photo EntityPhoto-circle-5 lazy-image ember-view</syntax-highlighted>

    The element previously had no id, but after the line has id of "ClickMe"



    ------------------------------
    ZACHARY SILVERSTEIN
    ------------------------------