Closed lhorie closed 10 years ago
See this jsfiddle: http://fiddle.jshell.net/uTatY/1/show/light/
Notice that the script produces invalid xpath:
//============================================================================== // Casper generated Mon Mar 17 2014 15:44:00 GMT-0400 (Eastern Daylight Time) //============================================================================== var x = require('casper').selectXPath; casper.options.viewportSize = {width: 1366, height: 383}; casper.test.begin('Resurrectio test', function(test) { casper.start('http://fiddle.jshell.net/uTatY/1/show/light/'); casper.waitForSelector(x("//*[normalize-space(text())=\'a\'b\']"), function success() { test.assertExists(x("//*[normalize-space(text())=\'a\'b\']")); }, function fail() { test.assertExists(x("//*[normalize-space(text())=\'a\'b\']")); }); casper.run(function() {test.done();}); });
I tried """ or "''", but apprently the only way to write propely is: x("//*[normalize-space(text())=concat('a', \"'\", 'b')]")
x("//*[normalize-space(text())=concat('a', \"'\", 'b')]")
See this jsfiddle: http://fiddle.jshell.net/uTatY/1/show/light/
Notice that the script produces invalid xpath: