Currently conducting tests using webdriver.io and phantom.js. The first test works successfully, providing a list of elements:
return client
.url(config.host)
.waitForVisible('#myvenuelist', 2000)
.click('#myvenuelist')
.elements('li.venue')
.then(function(venues)
{
// Ensure there is at least one venue
// Can perform a scan before to check the size
venues.value.length.should.be.at.least(venueList.length);
done();
});
However, moving on to the next test, it involves similar actions:
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();
});
After retrieving the deviceList object, attempting to access the array results in an error:
CommandError: Promise was fulfilled but got rejected with the following reason: Error: SyntaxError: DOM Exception 12
This issue is perplexing. Despite finding reports of DOM Exception 12 errors, they do not seem relevant to my scenario, especially considering we are using Phantom.js version 1.9.8.