On my webpage, I have set up two input text boxes and a label. My aim is to extract the numbers from these elements, sum up the numbers in the text boxes, and then compare the total with the number in the label. Does anyone know how I can achieve this?
Here's what I've tried so far, but unfortunately, it's not yielding the desired outcome. It seems that the value returned by getAttribute method is enclosed in apostrophes which causes issues when trying to convert it using parseInt, resulting in "NaN".
element(by.id('textbox1')).getAttribute('value').then(function(value){
textbox1Value = value;
});
element(by.id('textbox2')).getAttribute('value').then(function(value){
textbox2Value = value;
});
element(by.id('label1')).getText().then(function(value){
label1Value = value;
});
expect(textbox1Value + textbox2Value).toEqual(label1Value);