Hi I'm trying to click on select button using xpath and css selector but it doesn't works
browser.find_elements_by_xpath('//div[@class="section-select-all"]').click()
browser.find_elements_by_css_selector('#results-container > form > ul > li:nth-child(1) > div > div > button').click()
browser.find_elements_by_xpath('//*[@id="results-container"]/form/ul/li[1]/div/div/button').click()
please let me know how it would be here is the code
<div class="section-actions"><button type="button" class="section-select-all">Select 50<span class="screen-reader-text"> for section Dec 11, 2015</span></button></div>
We can type Enter/Return key in Selenium. We shall use the sendKeys method and pass Keys. ENTER as an argument to the method. Also, we can use pass Keys.
For automating the right-click operation, Selenium provides a dedicated method – contextClick(). This method accepts the target WebElement as the argument. In order to use this method, use the Actions class object. The method of locating the desired element remains the same.
You're using elements
that will not work. Use element
instead. I am sure it will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With