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
3 years agoContributor
Thanks for your response. Could you expand on this a little for me? Maybe an example?
- tphillips3 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.
- geneticmaterial3 years agoContributor
Hmm, that's giving me a "type mismatch" at position 10 which is the start of .addEventListener
- tphillips3 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
Recent Discussions
- 3 days agovladd1