0

I have this code:

IJavaScriptExecutor js = driver as IJavaScriptExecutor;
var colorCSS = js.ExecuteScript(@"jQuery('alert-danger').CSS('Background')");

And colorCSS doesn't contains bacgrounds value. Why?

If I use this jquery script in console, than it works.

Has someone any ideas?

6
  • 1
    If it would have been in java i would suggest to use return in your query like return jQuery('alert-danger').CSS('Background'), hope its same in C# too Commented Mar 16, 2015 at 9:56
  • and also check for the return type if its string u should get it in String object by appending as string. Commented Mar 16, 2015 at 10:01
  • Yhank You !!! You are indispensable !!! Commented Mar 16, 2015 at 10:31
  • Yes try adding return it should be same in C# Commented Mar 16, 2015 at 10:31
  • possible duplicate of Get Value from ExecuteScript from JavaScriptExecutor Commented Mar 16, 2015 at 10:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.