Need help.
The TestComplete manuals talk about <script src=<fn>... and how to call functions from your scripts but don't actually show you an entire script example.
Smartbear manual
They say contentDocument... "It provides access to both functions defined directly on the web page as well as in external JavaScript scripts loaded by using <script src="filename.js"/>." but how do you actually 'load' the js?
In the example below I am trying to get this "Into" TestComplete.
It's simple and returns a page. (an obviously i changed the url and token)
But 'translating' that into a TC script is difficult. The manual 'almost gets me there'.
A simple yet practical example would be nice.
<HTML>
<Head>
<script src="https://c.com/sdk/js/sdk.capsvc.min.js"></script>
</HEAD>
<Body>
<script type="text/javascript">
SVC.authToken = 'xyz';
SVC.content.get({
id: 5,
onSuccess: function (data) {
document.getElementById('content-area').innerHTML = data;
},
onFailure: function (ex) {
alert(ex.status + ':' + ex.content);
}
});
</script>
<DIV id="content-area"/>
</Body>
</HTML>