am trying to use radio button in if statement

Support
  • https://www.youtube.com/watch?v=pBTyQuBaDo0
    from the above created video
    from the resource section i created a resource which i called proxycheckbox
    in the that resource i have two radio, proxy and no proxy
    so i want to code the two radio with if statement, that is if useproxy radio is selected , log use proxy is selected else log no proxy
    my challenge now is which command to use to achieve this

  • You have EXAMPLE code within your BAS installation.
    It is located in your installation folder >
    BrowserAutomationStudio\apps\25.4.1\examples

    There are 4 example projects, and 4th project is
    "SiteVisitor.xml"
    There you can see how to use radio buttons for proxy options.

  • @GaG thanks let me check

  • The radio button was designed and wasn't added in the code
    secondly this code here does it still work because after testing i get no response from it

    (({{proxies}}).length) > (0)

    https://prnt.sc/TJy9bCDSeRVT

  • That is just example code, you will have to figure out
    how to use it in your user case. Study how that script
    is written and apply that to your own code.

    Yes, code still works flawlessly.

    When opening it in BAS make sure to validate it for current
    version. That option will be offered when you firstly open that
    code in BAS. If you missed it you can update it from the
    "Script editor" menu - last option is > "Update project actions"

    Furthermore, for script to work you need to add proxies and
    select correct proxies type. But in order to just run script for
    testing purposes you can run it without any proxy - make sure
    to change resource option for proxy to "FixedString" and leave
    proxy field empty. By default it is set to "LinesFromFile" so that
    might be the problem to run script successfully - it expects that
    you link your TXT file with list of proxies. Make sure to enter some
    target web page/address as well, so the script will work.

    In example code radio buttons are used to choose http or socks
    proxy. And that code you are trying to use does not use radio button.
    It simply uses proxy from TXT list or single value, and if you leave it
    blank it will not use proxy at all. So in your case you might not need
    radio buttons to tell script to work with or without proxy, just leave
    empty value field in order not to use proxy or populate it to use proxy.