Closed Bug 1048551 Opened 11 years ago Closed 10 years ago

using By.CSS_SELECTOR sometimes returns "JavascriptException: No such strategy"

Categories

(Remote Protocol :: Marionette, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1094441

People

(Reporter: dmosedale, Unassigned)

Details

(Whiteboard: [affects=loop])

This shouldn't be possible, I don't think. More details here once I have code to link to.
I only get this when I've spelt CSS_SELECTOR wrong :D
Zac: :-) Sorry for not filling in the details sooner. Here they are: Configuring and running functional tests in Loop is (partly) described at <http://mxr.mozilla.org/mozilla-central/source/browser/components/loop/README.txt#25>. Feel free to reach out to me in IRC for more help at any time. :mdas also has a tree configured, I believe. <http://mxr.mozilla.org/mozilla-central/source/browser/components/loop/test/functional/test_1_browser_call.py#80> has the code in question. The line currently in the code: url_input_element = self.wait_for_element_displayed(By.CLASS_NAME, "callUrl") works just fine, but it's making our code more fragile than it needs to be, because we don't really need to expose this class name at all, we want something fetched by a relatively complex selector. Unfortunately, using any selector at all makes Marionette fall over. Switching that line to be: url_input_element = self.wait_for_element_displayed(By.CSS_SELECTOR, ".callUrl") Makes the test fail with this output: env LOOP_SERVER=/Users/dmose/r/loop-server mach marionette-test browser/components/loop/test/functional/manifest.ini 0:06.19 LOG: MainThread INFO starting httpd 0:06.19 LOG: MainThread INFO running webserver on http://127.0.0.1:54425/ 0:06.19 SUITE_START: MainThread 1 0:06.20 TEST_START: MainThread test_1_browser_call.py Test1BrowserCall.test_1_browser_call Server listening on http://localhost:5001 node server.js Serving repository root over HTTP at http://localhost:3001/ Static contents are available at http://localhost:3001/content/ Tests are viewable at http://localhost:3001/test/ Use this for development only. 0:13.02 TEST_END: MainThread ERROR, expected PASS Traceback (most recent call last): File "/Users/dmose/r/gecko-dev/testing/marionette/client/marionette/marionette_test.py", line 171, in run testMethod() File "/Users/dmose/r/gecko-dev/browser/components/loop/test/functional/test_1_browser_call.py", line 149, in test_1_browser_call call_url = self.get_and_verify_call_url() File "/Users/dmose/r/gecko-dev/browser/components/loop/test/functional/test_1_browser_call.py", line 87, in get_and_verify_call_url url_input_element = self.wait_for_element_displayed(By.CSS_SELECTOR, ".callUrl") File "/Users/dmose/r/gecko-dev/browser/components/loop/test/functional/test_1_browser_call.py", line 39, in wait_for_element_displayed .until(lambda m: m.find_element(by, locator).is_displayed()) File "/Users/dmose/r/gecko-dev/testing/marionette/client/marionette/wait.py", line 122, in until rv = condition(self.marionette) File "/Users/dmose/r/gecko-dev/browser/components/loop/test/functional/test_1_browser_call.py", line 39, in <lambda> .until(lambda m: m.find_element(by, locator).is_displayed()) File "/Users/dmose/r/gecko-dev/testing/marionette/client/marionette/marionette.py", line 1278, in find_element response = self._send_message('findElement', 'value', **kwargs) File "/Users/dmose/r/gecko-dev/testing/marionette/client/marionette/decorators.py", line 35, in _ return func(*args, **kwargs) File "/Users/dmose/r/gecko-dev/testing/marionette/client/marionette/marionette.py", line 638, in _send_message self._handle_error(response) File "/Users/dmose/r/gecko-dev/testing/marionette/client/marionette/marionette.py", line 686, in _handle_error raise errors.JavascriptException(message=message, status=status, stacktrace=stacktrace) JavascriptException: JavascriptException: No such strategy. 0:13.09 LOG: MainThread INFO SUMMARY ------- 0:13.09 LOG: MainThread INFO passed: 0 0:13.09 LOG: MainThread INFO failed: 1 0:13.09 LOG: MainThread INFO todo: 0 0:13.09 LOG: MainThread INFO FAILED TESTS ------- 0:13.09 LOG: MainThread INFO test_1_browser_call.py test_1_browser_call.Test1BrowserCall.test_1_browser_call 0:13.11 SUITE_END: MainThread Summary ======= Ran 1 tests Expected results: 0 Unexpected results: 1 (ERROR: 1) Unexpected Results ================== ERROR test_1_browser_call.py Test1BrowserCall.test_1_browser_call
Whiteboard: [affects=loop]
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.