Ill-Formed Xpath Expression Crashes Firefox Using Marionette

RESOLVED INCOMPLETE

Status

defect
RESOLVED INCOMPLETE
4 years ago
3 years ago

People

(Reporter: joshin4colours, Unassigned)

Tracking

({pi-marionette-server})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [marionette=1.0])

Reporter

Description

4 years ago
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150630154324

Steps to reproduce:

Using Firefox Developer Edition 41.0a2 (2015-08-06) on Windows 8.1, I ran the following test using python 2.7.6 and py.test:
```
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import WebDriverWait

import unittest

class TestBrowser(unittest.TestCase):
		
		
	def test_navigate(self):
		firefox_capabilities = DesiredCapabilities.FIREFOX
		firefox_capabilities['marionette'] = True
		firefox_capabilities['binary'] = 'C:\\Program Files (x86)\\Firefox Developer Edition\\firefox.exe'
		
		driver = webdriver.Firefox(capabilities=firefox_capabilities)
		wait = WebDriverWait(driver, 5)
		
		driver.get('http://the-internet.herokuapp.com/')
	
		link = wait.until(lambda x: x.find_element_by_xpath("//a[bad='xpath']"));
		link.click()
		
		assert driver.title == 'tourdedave/the-internet'
```


Actual results:

at the line
```
link = wait.until(lambda x: x.find_element_by_xpath("//a[bad='xpath']"));
```

Firefox crashes unexpectedly.


Expected results:

Based on other WebDriver browser tests, an exception would be thrown stating there's an ill-defined xpath expression and the test would fail.
Reporter

Updated

4 years ago
Summary: Ill-Formed Xpath → Ill-Formed Xpath Expression Crashes Firefox Using Marionette
Whiteboard: [marionette=1.0]
I wonder if this is a problem indeed, ie if the xpath expression "//a[bad='xpath']" has wrong syntax. I apologize in advance, if I miss something!


```
$ cat > test.py
# Adapted from xpath.py found at http://xmlsoft.org/python.html  
import libxml2, sys

doc = libxml2.parseFile("tst.xml")
ctxt = doc.xpathNewContext()
res = ctxt.xpathEval("//a[bad='xpath']")
if res:
    print str(res[0])

doc.freeDoc()
ctxt.xpathFreeContext()


$ cat > tst.xml 
<?xml version="1.0" encoding="UTF-8"?>
<a>
<bad>xpath</bad>
</a>
$ python test.py 
<a>
<bad>xpath</bad>
</a>
$ cat > tst.xml 
<?xml version="1.0" encoding="UTF-8"?>
<z>
<bad>xpath</bad>
</z>
$ python test.py 
$ 
```
looks like this has been been fixed in the past or the underlying cause has now gone.
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.