I'm having trouble getting the background color of the link using the following code and standalone selenium 2.53.0 and Firefox 50.0.2661.75 m or Chrome:
Although during the test I do not see mouse movement, at the bottom of the browser window in the status bar, I see the URL change in the HREF link.
I cannot raise a hang event for any elements, so the background color is always the default color, not the color specified. Any ideas around this?
browser.moveToElement('a[href="http://www.foo.com"]',2,2, function() {
browser.pause(2000)
.getCssProperty('a[href="http://www.foo.com"]', "background-color", function(results){
console.log('color: ' + results);
});
});
If I remove getCssProperty from the callback, I still don’t get the correct background color to hang and I don’t see the mouse pointer moving:
browser.moveToElement('a[href="http://www.foo.com"]',2,2)
.pause(2000)
.getCssProperty('a[href="http://www.foo.com"]', "background-color", function(results){
console.log('color: ' + results);
});
Kunle source
share