Robotic Process Automation (RPA)

 View Only
  • 1.  Using Wildcard

    Posted Fri July 14, 2023 12:22 PM

    Hi,

    I have a problem using click on webpage,

    Is it possible to put a wildcard in the CSS path? Because the CSS code sometimes changes some random number. So when I re-run the bot, it clicks anywhere, not in the point I mapped. 

    This is the code:
    webClick --selector "CssSelector" --css "#tm1web_workbook_GridPane_0 > div.tm1webGridPaneContainer > div:nth-child(3) > div.tm1webGridCell.s_16874034838120_f_ssS0.s_16874034838120_f_ssS0R4.s_16874034838120_f_ssS0C1.s_16874034838120_f_ss28.tm1webGridCellString" --simulatehuman  --comment SiteCell


    Thank you!

    Regards,



    ------------------------------
    John Wilfred Enal
    ------------------------------


  • 2.  RE: Using Wildcard

    Posted Tue July 18, 2023 12:53 PM

    Hi John! You can definitely make the CSS more dynamic. I would highly recommend trying to make it more specific, like using tags and attributes that are unique to the element you are targeting. Most of the time, using the full CSS selector will result in a match that won't adapt very well to minor website changes.

    Here are some strategies you can use to make the selector more robust: https://www.w3schools.com/cssref/css_selectors.php

    Please note that if you want to also match by text (useful when no tag/attribute can be easily found), then you should consider using XPath instead of CSS.



    ------------------------------
    Vinicius Marques
    ------------------------------



  • 3.  RE: Using Wildcard

    Posted Tue August 01, 2023 11:48 PM

    Hi Vinicius! Thank you for the reply. I tried using Xpath, it works! I will try the selector in css.

    Thank you!



    ------------------------------
    John Wilfred Enal
    ------------------------------