Forum Discussion
ArtemS
13 years agoSmartBear Alumni (Retired)
Hello Curt,
Yes, these are the objects corresponding to the HTML tags. TestComplete did not have access to the JavaScript run-time objects (except for the document and window objects), it can access only the page's on-screen objects (yet, the latter could be invisible to the end-user). That is why, I suggested your developers adding the auxiliary info to the web elements.
>>Can the javascript modify the HTML tags?
Yes, it is possible to add and modify the existing HTML tags from JavaScript. For instance, the following HTML appends one more paragraph to it and alters the text color through the JavaScript functions:
Yes, these are the objects corresponding to the HTML tags. TestComplete did not have access to the JavaScript run-time objects (except for the document and window objects), it can access only the page's on-screen objects (yet, the latter could be invisible to the end-user). That is why, I suggested your developers adding the auxiliary info to the web elements.
>>Can the javascript modify the HTML tags?
Yes, it is possible to add and modify the existing HTML tags from JavaScript. For instance, the following HTML appends one more paragraph to it and alters the text color through the JavaScript functions:
<html>
<head>
<title>Modifying HTML body</title>
</head>
<script language="javascript">
function appendp() {
var p = document.createElement("p");
var texto = document.createTextNode("Text.....");
p.appendChild(texto);
document.body.appendChild(p);
}
function setcol() {
var p = document.getElementsByTagName("P")[0]
p.setAttribute("style","color:green")
}
</script>
<body>
<p>Lorim ipsum dolores sit amen</p>
<button onclick=appendp()>Append Paragraph</button>
<button onclick=setcol()>Change Color</button>
</body>
</html>
Related Content
Recent Discussions
- 5 hours agoSvetaG