Robotic Process Automation (RPA)

 View Only
Expand all | Collapse all

How to open url in a new tab in the existing browser instance with IBM RPA web automation

  • 1.  How to open url in a new tab in the existing browser instance with IBM RPA web automation

    Posted Thu August 03, 2023 11:22 AM

    Dear All,

    Greetings to you!

    I'm trying to open URL in a new tab on the same browser window that has the user login context.

    Recorder did not capture the sequence of opening the url in a new tab.

    As a result, the generated script tries to open the url in the same tab and that fails.

    Kindly share your suggestions on how can it be accomplished with IBM RPA.

    Thanks in advance for your suggestions.

    Best Regards,

    DB



    ------------------------------
    Durga Bhavani Uppuluru
    ------------------------------



  • 2.  RE: How to open url in a new tab in the existing browser instance with IBM RPA web automation

    Posted Fri August 04, 2023 03:16 AM

    Hi DB,

    Have you tried a right-click - Open link in a new tab mechanism on the link from the first page instead of using the recorder?



    ------------------------------
    xavier nicolas
    ------------------------------



  • 3.  RE: How to open url in a new tab in the existing browser instance with IBM RPA web automation

    Posted Fri August 04, 2023 07:31 AM

    Hi DB,

    If you want to open the URL link in a new tab the <a href=.....> tag should have an attribute target = "_blank".

    If the attribute is missing then you  have two ways:

    1. Change the HTML code and add the attribute target = "_blank" to the <a> tag.
    2. Use webInjectJavaScript:

             webNavigate --url "[your page]"
             webInjectJavaScript --script "var links = document.getElementsByTagName(\'a\');\r\nvar len = links.length;\r\n\r\nfor(var i=0; i<len; i++)\r\n{\r\n   links[i].target = \"_blank\";\r\n}"
             webClick --selector "CssSelector" --css "body > a"

    I hope this will help you to resolve the issue.

    Regards,



    ------------------------------
    Stanislav Terziev
    ------------------------------



  • 4.  RE: How to open url in a new tab in the existing browser instance with IBM RPA web automation

    Posted Fri August 04, 2023 07:36 AM

    Good to know :) tx Stanislav for the insight



    ------------------------------
    xavier nicolas
    ------------------------------