text: console.log("Chal gaya bhidu");
  
  let msgsSent = 0;
  
  // window.onload = 
  async function runhere() {
      console.log("inside iscontact");
      const totalMsgsToSend = 2;
      // parseInt(document.getElementById('total_results_count').innerText) || 2;
  
      while(msgsSent < totalMsgsToSend) {
          console.log({msgsSent, totalMsgsToSend});
          await btnClicks(msgsSent);
          window.scrollBy(0, 100);
          msgsSent++;
      }
  }
  
  function btnClicks() {
      return new Promise((resolve, reject) => {
          setTimeout(() => {
              // console.log(document.querySelectorAll('[index="1"]').getElementsByClassName('send_message'));
              let initialButton = document.getElementsByClassName('send_message')[msgsSent];
              initialButton.click();
              console.log("Before Timeout");
              setTimeout(() => {
                  console.log("Inside Timeout");
                  let laterButton = document.getElementById('chat_send_button');
                  laterButton.click();    
                  resolve();
              }, 1000)
              console.log("Outside Timeout");
          }, 3000)
      })
  }
  runhere();