Selenium has two functions for locating via xpath.
find_element_by_xpath which returns the first matching element or raises an exception if no matching elements are found.
find_elements_by_xpath (note the 's' on the end of elements) which returns a list containing every matching element; which will be empty in the case of no matching elements.
You're using ...
I encountered this problem today, as well. The commands I use is:
robot someTest.robot --variablefile /path/to/my/resource
But it fails with:
[ ERROR ] Parsing '--variablefile' failed: File or directory to execute does not exist.
Try --help for usage information.
But when I robot someTest.robot or ls /path/to/my/resource, I can run the test/check the file....
May be you need apply Explicit waits and try different xpath.
Apply Wait like below and try:
# Imports Required
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
wait = WebDriverWait(driver,30)
deletebutton = wait.until(EC....
While working in a professional testing company, we have developed test scripts for various applications which require handling alerts for camera and mic.
You can resolve this issue by adding argument "use-fake-ui-for-media-stream" in your chrome option list.
Attached is screenshot for your reference -
I am not familiar with Python, but I can make some suggestions.
First, visit the Selenium documentation site. You can find examples and detailed documentation using Selenium with Python here.
Next, to answer your specific question, instead of searching by class name, look for something that is unique to the item/s you are searching for. You may need to find ...