Hi. I need to use a defined string in more than one test step, but I don't know how to do this. So in my code I have this in a test step;
'get number value': function (browser) {
browser.getText('div:nth-child(1) > .accordion__navigation .trim-level__equipment__heading__count', function
(basicEquipmentEntries) {
var numberOfBasicEquipmentEntries = (basicEquipmentEntries.value).replace(/\D/g,'');
console.log('basic equipment entries = ', numberOfBasicEquipmentEntries);
},
'compare the number value with number of elements': function (browser) {
browser.expect.elements('div:nth-child(1) > div.accordion__content.hide ul li').count.to.equal(numberOfBasicEquipmentEntries);
};
And I'd also like to use the value of **numberOfBasicEquipmentEntries** later in the test script.
Is there a way to do this?
Any help would be greatly appreciated. Thanks.