I experimented with using jQuery on a webpage that has already been modified by jQuery in order to add custom CSS code:
jQuery('head').append('<style type=\"text/css\">body { background: #000; }</style>');
When I ran this code, the page's background immediately changed to black, which was expected. However, when attempting the same action using Selenium 2 (Java), there was no visible change:
((JavascriptExecutor) webDriver).executeScript("jQuery('head').append('<style type=\"text/css\">body { background: #000; }</style>');");
It seems like jQuery is being loaded correctly. Any thoughts on why this approach doesn't seem to be working as expected?