[![first page][1]][1]
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import random
import select
driver = webdriver.Chrome('ChromeDriver')
driver.get("https://devbusiness.tunai.io/login")
time.sleep(2)
driver.maximize_window()
#log in credentials
username = driver.find_element(By.NAME, "loginUsername");
username.send_keys("xxxxx");
password = driver.find_element(By.NAME, "loginPassword");
password.send_keys("xxxxx");
login = driver.find_element(By.XPATH,"//*[@id='app']/div/div/div/div/div/div[2]/form/div[4]/button");
login.submit();
time.sleep(3)
driver.get("https://devbusiness.tunai.io/dashboard/my_salon_user")
time.sleep(3)
randomUsername = random.choice(["dayon.salon3@tunai","dayonmanager@tunai","Dayon.der@tunai"])
driver.find_element(By.XPATH, "//tbody[@role='rowgroup']/tr[@role='row']/td/a[text()='"+ randomUsername +"']").click()
print("Username selected: ", randomUsername)
time.sleep(5)
driver.find_element(By.XPATH,"//*[@id='page-content']/div/div[3]/div/div[2]/div/div/div[2]/div/div[1]/header/a").click()
time.sleep(5)
# Get the list of elements
elements = driver.find_elements(By.CLASS_NAME,'custom-control-input')
# Select a random element from the list
random_element = random.choice(elements)
driver.execute_script("arguments[0].click();", random_element)
# Click on the selected element
random_element.click()
print("Element selected: ", random_element)
time.sleep(5)
driver.find_element(By.XPATH,"//*[@id='accKey']").click()
time.sleep(5)
I've been add "argument.click[]","webdriver wait until EC to be clickable"
but still showing "Element not interactable
. What would be the other possible solution? Hope someone could clarify for me. Thanks and have a nice day.
[![second page][2]][2]