I currently have a selenium python script that is working with PhantomJS, but not Firefox. I get this error:
NoSuchElementException('Unable to locate element: Research Project', None, None)
Specifically, it fails on this line of code:
self.webdriver.find_element_by_link_text("Research Project").click()
I've tried some different wait methods with no luck, such as:
WebDriverWait(self.webdriver, 10000).until(EC.presence_of_element_located((By.LINK_TEXT, "Research Project")))
I've also tried using various Xpaths to test if the link text isn't specific enough, which resulted in an ElementNotInteractableException if no wait was implemented, or the wait timing out if implemented.
If it helps, my PhantomJS webdriver is defined as:
args = [
'--ignore-ssl-errors=true',
'--ssl-protocol=any',
'--web-security=false'
]
driver = webdriver.PhantomJS(service_args=args, executable_path='/usr/bin/phantomjs', service_log_path='/tmp/ghostdriver.log')
And my Firefox webdriver is simply defined as:
driver = webdriver.Firefox(executable_path='/usr/local/Cellar/geckodriver/0.21.0/bin/geckodriver')
I can provide more detail if necessary. Any help would be greatly appreciated.
The HTML for the object I'm trying to reference:
<a href="#" id="dynaTempSelView:dynaTempSelForm:tree_selector:newLinksDT:0:close_tree" name="dynaTempSelView:dynaTempSelForm:tree_selector:newLinksDT:0:close_tree" onclick="RichFaces.ajax("dynaTempSelView:dynaTempSelForm:tree_selector:newLinksDT:0:close_tree",event,{"parameters":{"node_id":5627697,"ajaxRequest":"true"} ,"incId":"1"} );return false;" class="publicationTypeLink ariaHasPopup ariaExpanded" onblur="overviewAddnew(null);unselectedDiv(this);" onfocus="overviewAddnew(this);selectedDiv(this);" onmouseout="overviewAddnew(null);unselectedDiv(this);" onmouseover="overviewAddnew(this);selectedDiv(this);" aria-describedby="dynaTempSelView:dynaTempSelForm:tree_selector:newLinksDT:0:hiddenDescriptiontree_closed" aria-haspopup="true" aria-expanded="true"><div id="dynaTempSelView:dynaTempSelForm:tree_selector:newLinksDT:0:closeTree" style="padding-left:20px;" class="unselectedDiv"><img src="/converis/javax.faces.resource/images/collapsible_panel_triangle_state_expanded.png.xhtml?ln=intern" alt=""><span style="padding-left:15px;">Research Project </span></div><span id="dynaTempSelView:dynaTempSelForm:tree_selector:newLinksDT:0:hiddenDescriptiontree_closed" style="display: none;">Research Project</span></a>