Forum Discussion

delito's avatar
delito
Occasional Contributor
3 years ago

Getting the state of a checkbox that is not a clickable point due to CSS

Hi   Using Chrome and TC JavaScript I am trying to get the state of a checkbox on a screen but this screen has CSS applied to the checkbox so they have become a non clickable point like so:     ...
  • delito's avatar
    3 years ago

    I managed to remove the classes from the screen for the CSS, that made the check boxes usable

     

     

     

     

     

    function DisableCSSClass()
    {
      let browser = Aliases.browser;
      let page = browser.pageClientApp4;
      var elements = page.FindElements('//*[@class="form-control with-font ng-untouched ng-pristine ng-valid"]').toArray();
    
      if (elements.length > 0)
      {
        for (var i = 0; i < elements.length; i++)
        {
          elements[i].className="form-control ng-untouched ng-pristine ng-valid";
        }
      }
      else
      {
        Log.Message("No element with this class found on the page.");
      }
    }