python selenium issue with find.element

78 views Asked by At

In python selenium. i did use it many time but for one reason i can't fix this pbl:

I cannot find a way to display the code properly using code or blockquote, my bad.

I did try with By.XPATH and By.ID but no way, I am still going in except:

running the latest chrome (121.0.6167.140) and the latest chromedriver 32 bits (20/01/2024)
The page get open but i see "------------username failed" in my ouput cmd line in windows
running python 3.8.6rc1 and the latest selenium "pip install selenium"

html:

<input type="text" name="arg01_UserName" id="arg01_UserName" class="style639" maxlength="64" data-bind="visible: arg01_UserNameVisible, value: arg01_UserNameValue">

python:

 options = webdriver.ChromeOptions()
 #options.add_argument('log-level=3')
 options.add_argument('--ignore-ssl-errors=yes')
 options.add_argument('--ignore-certificate-errors')> 
 options.add_argument('--disable-proxy-certicifcate-handler')
 options.add_argument("--headless")#for debug 
 
 driver = webdriver.Chrome(executable_path="C:\\tmp\\webbot\\chromedriver.exe",options=options)
 
 driver.implicitly_wait(8)
 driver.get ('http://192.168.10.13/')
 time.sleep(7)
 print ("before login")
 
 try:
 element = 
    #driver.find_element(By.ID,"arg01_UserName").send_keys("Admin") # tested but failed                 but not working too
    element =        driver.find_element(By.XPATH,"/html/body/form/div/div[3]/div[2]/div[1]/div/div/div[3]/div/table/tbody/tr[1]/td[3]/table/tbody/tr[2]/td/input")

    element.send_keys("Admin")
 except:
    print("-------------------username failed)

I am expecting to insert Admin in the field username of a printer kyocera with IP 192.168.10.13.

0

There are 0 answers