We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
Hi,
I think that such activities can be done by either modifying page markup or/and injecting additional page script code. Read this article and consider whether it can help: https://support.smartbear.com/testcomplete/articles/embedding-scripts-into-web-pages/
Never mind, I sorted it out, should use contentDocument instead
I would like to perform some suspicious activities on my test page and see if they are handled properly. For instance, making a required field to optional, or hacking a disabled button to enabled by manipulating through the developer console, things like that.
Hi,
I think that such activities can be done by either modifying page markup or/and injecting additional page script code. Read this article and consider whether it can help: https://support.smartbear.com/testcomplete/articles/embedding-scripts-into-web-pages/
Thanks, I think this works
I followed the example in the given article, but not sure how to set the script type to JavaScript in VBScript. It is giving this error message to me.
Never mind, I figured it out.
Hi again,
I am getting error from the codes that was working 2 month ago. It is complaining "Unable to find the object Application. See Details for additional information.", but it was working before with the exact same codes. Any idea what is going on?
PageDocument = Aliases.browser.Page("*").Application.document
body = PageDocument.body
script = PageDocument.CreateElement("script")
Call script.setAttribute("type", "text/javascript")
script.text = "function disableButton() { document.getElementById(""btnSignin"").disabled = ""disabled""; }disableButton();"
script = Body.InsertBefore(script, null)
What has changed since the last time the code worked? Windows upgrades, browser upgrades, TestComplete upgrades, change in test environment?
Don't remember what has been changed, it has been a while, but our IT team has switched the anti-virus software to another one that I can be sure. Other tests are running good, so it is not the new anti-virus failing the test.
It is complaining on the first line PageDocument = Aliases.browser.Page("*").Application.document that Application couldn't be found, I believe it is a browser page property, so even though my environment changed, they should impact the browser page properties.
I grab the codes from https://support.smartbear.com/testcomplete/articles/embedding-scripts-into-web-pages/, but this page seems not available anymore