Commit 31c75d8d by Javier

m

parent ceb21a03
File added
This diff is collapsed. Click to expand it.
...@@ -7,7 +7,6 @@ magnus = "http://192.168.2.56/mbilling/index.php" ...@@ -7,7 +7,6 @@ magnus = "http://192.168.2.56/mbilling/index.php"
login = { login = {
'user' : 'root', 'user' : 'root',
'password' : 'NgtAtONgeRaFtsbu', 'password' : 'NgtAtONgeRaFtsbu',
'key' : ''
} }
class Tarifa(Enum): class Tarifa(Enum):
......
from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
import time
magnus = "http://192.168.2.56/mbilling/"
login = {
'user' : 'root',
'password' : 'NgtAtONgeRaFtsbu',
}
def authenticate(driver : webdriver.Firefox):
driver.get(magnus)
WebDriverWait(driver,3).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="textfield-1013-inputEl"]'))).send_keys(login['user'])
driver.find_element(By.XPATH,'//*[@id="textfield-1014-inputEl"]').send_keys(login['password'], Keys.ENTER)
def add_new_user(driver : webdriver.Firefox, telefono : str):
# Acceso a Panel
WebDriverWait(driver,3).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="treeview-1176-record-10"]'))).click()
WebDriverWait(driver,3).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="button-1270"]'))).click()
WebDriverWait(driver,3).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="textfield-1291-inputEl"]'))).clear().send_keys(telefono)
if __name__ == '__main__':
options = FirefoxOptions()
#options.add_argument("--headless")
driver = webdriver.Firefox(options=options)
authenticate(driver)
add_new_user(driver, '956367300')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment