Here is my javascript code (in Selenium IDE, with newlines and indentation added for clarity): storeEval |
var input = window.document.getElementsByTagName('input');
for(var i = 0; i<input.length; i++) {
if(window.document.defaultView.getComputedStyle(input[i]).getPropertyValue('background-color') == 'rgb(204, 230, 255)') {
testResult='passed';
} else {
testResult='failed';
}
}
| testResult
I need to check color of all inputs. But Selenium Ide stores the result of test only from the last “INPUT”. I’m sure there are errors in the middle of the test. Help please. Sorry for my bad english
What you should modify:
testResultis given a default valuebreakis added when the test fails in order to stop theforloopHere’s your code updated: