code: function getClosestIdNode(target, isAllDom){
          var current = target;
          var body = target.ownerDocument.body;
          while(current !== null){
              if(current.nodeName !== 'HTML'){
                  var testidValue = current.getAttribute && current.getAttribute('data-testid');
                  var idValue = current.getAttribute && current.getAttribute('id');
                  if(testidValue && checkUniqueSelector(body, '[data-testid="'+testidValue+'"]', isAllDom)){
                      return {
                          node: current,
                          path: '[data-testid="'+testidValue+'"]'
                      };
                  }
                  else if(idValue && reAttrValueBlack.test(idValue) === false && checkUniqueSelector(body, '#'+idValue, isAllDom)){
                      return {
                          node: current,
                          path: '#'+idValue
                      };
                  }
                  current = current.parentNode;
              }
              else{
                  current = null;
              }
          }
          return null;
      }
docs: 读取最近的id唯一节点