2

I have a test where I have to check that when a particular item is selected on a web page, the item is loaded into a flash object on the same page. This being done via Javascript. I have to check whether the parameters being passed to flash by Javascript are correct(i.e. the right item is being passed to flash). The only way I can imagine as of now is to intercept these javascript functions and somehow read their parameters. Can anyone suggest how to do this? You can suggest other workarounds too...

1 Answer 1

2

Assuming that you have a JavaScript object, in this case called Foobar, that does the call to your Flash app you can do something along these lines.

selenium.RunScript(@"var foo = new Foobar();
                   foo.oldBlah = foo.blah;
                   foo.blah = function(){
                      // run some code to do the checks maybe putting into a global Javascript variable
                      foo.oldBlah();
                   };");
selenium.GetEval("var win = this.browserbot.getUserWindow(); return win.globalVarCreatedAbove");

I haven't tested this but hopefully you get the gist of that I am trying to do.

Sign up to request clarification or add additional context in comments.

Comments

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.