javascript - Phantom.js Webdriver.io Error: SyntaxError: DOM Exception 12 -
we doing testing webdriver.io, , phantom.js. following works fine, gives me list of elements:
return client .url(config.host) .waitforvisible('#myvenuelist', 2000) .click('#myvenuelist') .elements('li.venue') .then(function(venues) { // make sure there @ least 1 device // scan in before , check size venues.value.length.should.be.at.least(venuelist.length); done(); });
but go on next test, same thing:
return client .url(config.host) .waitforvisible('#myvenuelist', 2000) .click('#myvenuelist') .waitforvisible("li.venue[data-id=" + allvenues[0].venue_id + "]", 5000) .click("li.venue[data-id=" + allvenues[0].venue_id + "] a[class='btn primary']") .waitforvisible('a[class="tab beacons"]', 2000) .click('a[class="tab beacons"]') .waitforvisible('a[class="tab beacons active"]', 2000) .elements("a[class='add-monitor btn primary']") .then(function(devicelist) { devicelist.value.length.should.be.at.least(1); done(); });
i devicelist object. if inspect it, value member array, expected. second try access array, if assigning variable, following error:
commanderror: promise fulfilled got rejected following reason: error: syntaxerror: dom exception 12
this driving me crazy. there reports of dom exception 12 error around, don't seem apply i'm doing, , many of them refer old versions of phantom.js. on 1.9.8.
try this:
let venueid = allvenues[0].venue_id; return client .url(config.host) .waitforvisible('#myvenuelist', 2000) .click('#myvenuelist') .waitforvisible(`li.venue[data-id={venueid}]`, 5000) .click(`li.venue[data-id={venueid}] a.btn.primary`) .waitforvisible('a.tab.beacons', 2000) .click('a.tab.beacons') .waitforvisible('a.tab.beacons.active', 2000) .elements("a.add-monitor.btn.primary") .then( devicelist => devicelist.value.length.should.be.at.least(1) );
Comments
Post a Comment