1

I want to write a program that can fire up an IE browser, run some javascript code, and spit the results back to my program before closing the browser. Ideally, this could even happen over a network to a VM running IE.

I know Selenium can do something like this, but after looking at it for a bit I feel like I am missing something to understand how this works at a more detailed level.

I am also interested in understanding how DynaTrace is able to capture so much DOM metrics in IE, but again, don't know at all how this could happen. I suspect this is related to my original question of simply running and capturing javascript code results but please let me know if it is not the case.

What is involved to make this happen? Where do I start?

pnuts
  • 58,317
  • 11
  • 87
  • 139

1 Answers1

1

What do you want to achieve? Run generic javascript code, or you must run your JS in IE?

If you only need to run javascript, try a JS engine, for example Google's V8. Some releated questions:

If you need to run the code in IE, that would be more tricky...

Edit: also there are multiple JS unit test runner frameworks, if that's what you are looking for. Or maybe they can be good to get some ideas.

Edit:

Then you can use the winforms WebBrowser control. Check out these on how to execute JS code in a WebBrowser control from C#:

Community
  • 1
  • 1
Akos Lukacs
  • 2,007
  • 1
  • 16
  • 21