Skip to content

Instantly share code, notes, and snippets.

Last active December 29, 2020 21:49
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
// this function allows us to stop our code for |ms| milliseconds.
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
// I've put our main code into this function.
async function addPeople() {
ul = $('')[0];
firstLi = ul.querySelector('li');
count = 0; // this is the count of how many people you've added
while(firstLi && count < 100){ // stop after adding 100 people
buttonToClick = firstLi.querySelector("button[data-control-name=invite]");
// make sure that this button contains the text "Connect"
if (buttonToClick.innerText.includes("Connect")){;
count += 1;
console.log("I have added " + count + " people so far.");
await sleep(1000); // stop this function for 1 second here.
firstLi = ul.querySelector('li');
Copy link

ravichalla commented Jul 28, 2018

The 8th line in code .... has to be replaced with
ul = $("ul#ember1225")[0];
to work , as UI side changes has been made .

Copy link

eladmw commented Dec 29, 2020

ember+___ it's not consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment