My goal is to use selenium to verify that a specific method (with parameters) was called on a JavaScript Object, similar to expectation mocking with JMockit but for Javascript and selenium.
Unfortunately, the object I am dealing with is a heavily obfuscated opaque website performance tracker, making it impossible for me to access its internals. This is why mocking appears to be my only option. Or am I overlooking something obvious?
Update: Upon further consideration, I believe a potential solution could involve: - Waiting for the HTML to fully load - Removing a certain script tag containing the performance tracker - Creating a javascript mock object that mimics the behavior of the tracker while also recording invocations for future use