Issue
In that website, I am looking how to select item (e.g "Green") in "Single" dropdown box and "Grouped" dropdown box.
I tried to click to dropdown first and tried to find the element inside it to click but I can't
Do you have any idea? and with Grouped dropdown I even couldn't find the xpath to click on it
Thank in advance
driver = webdriver.Chrome()
driver.get("https://react-select.com/home")
driver.maximize_window()
driver.implicitly_wait(20)
driver.find_element_by_xpath("//div[@class='select__value-container select__value-container--has-value css-1hwfws3']").click()
driver.find_element_by_xpath("//*[@text()='Green']").click()
Solution
remove @ from text
driver.find_element_by_xpath("//*[text()='Green']").click()
To click on options that are not visible:
option=driver.find_element_by_xpath("//*[text()='Silver']")
driver.execute_script("arguments[0].scrollIntoView();", option)
option.click()
You have to scroll first to that and then click
Answered By - PDHide
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.