Using Selenium In Python To Enter Currency Format Text
Trying to enter the value '100000' into a web form using Selenium in Python, but it is consistently not working no matter how I try to send it. I apologize for my lack of knowledg
Solution 1:
As you intend to send a character sequence instead of presence_of_element_located you need to use element_to_be_clickable and you can use either of the following solutions:
Using
CSS_SELECTOR:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "input.moneying.input.currency.error#moneying"))).send_keys("$1000.0")Using
XPATH:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//input[@class='moneying input currency error' and @id='moneying']"))).send_keys("$1000.0")Note : You have to add the following imports :
from selenium.webdriver.support.uiimportWebDriverWaitfrom selenium.webdriver.common.byimportByfrom selenium.webdriver.supportimport expected_conditions asEC
Post a Comment for "Using Selenium In Python To Enter Currency Format Text"