I want to click this element called "Select File", it is a button but i am unable to click it using selenium command. The the element I am about to click is as follows:
<label for="file" class="pb default" style="display: inline-block;margin: 5px 10px;">Select File</label>
the script I am using to click for that element is:
_test_=browser.find_elements_by_class_name("pb default")
_test_.click()
It gives an exception like this:
Traceback (most recent call last):
File "z:\test_selenium_impossible_click.py", line 58, in
<module>
_test_.click()
AttributeError: 'list' object has no attribute 'click'
I am using latest firefox version with latest webdriver for firefox
UPDATE : i have edited the code to become like this :
_test_=browser.find_element_by_class_name("pb default")
_test_.click()
but now it gives output like this :
Traceback (most recent call last):
File "z:\automator-python\test_selenium_impossible_click.py", line 57, in <module>
_test_=browser.find_element_by_class_name("pb default")
File "C:\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 564, in find_element_by_class_name
return self.find_element(by=By.CLASS_NAME, value=name)
File "C:\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: .pb default
i have tried the other ways like what has been suggested to me but it still gives output like what i mentioned above...do you know how to solve this??