Forum Discussion
tphillips
Frequent Contributor
You can't call TestComplete functions from events on web pages. It has to be a function the browser understands (e.g. an Alert), which TestComplete could then capture
geneticmaterial
4 years agoContributor
Thanks for your response. Could you expand on this a little for me? Maybe an example?
- tphillips4 years agoFrequent Contributor
Try changing your calls to Log.Message() to alert() calls (which the browser supports)
You can then capture the alert window using TestComplete and check the text in the alert.
function Test() { var browser = Sys.Browser("*"); var page = browser.Page("*").contentDocument; page.addEventListener("form_field_complete", function (e) { alert('Adobe event '.concat(e.type)); alert(e.detail); }); }
If you don't get any alerts, you know that your event isn't firing properly.
- geneticmaterial4 years agoContributor
Hmm, that's giving me a "type mismatch" at position 10 which is the start of .addEventListener
- tphillips4 years agoFrequent Contributor
You might need to play around with the page variable, you might have to remove the .contentDocument part when assigning it:
var page = browser.Page("*");
Related Content
- 6 years ago
- 13 years ago
- 2 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago