Ask a Question

Is TC able to manipulate webpage by using browser developer tool?

SOLVED
whuang
Regular Contributor

Is TC able to manipulate webpage by using browser developer tool?

Hi there,

I have a test that needs to manipulate webpages, just wondering if anyone know whether TC is able to manipulate webpage by using browser developer tool? I tried to use TC to spy the objects in chrome developer tool, but it didn't allow me to.

 

Thanks in advance

2 ACCEPTED SOLUTIONS

Accepted Solutions
AlexKaras
Community Hero

Re: Is TC able to manipulate webpage by using browser developer tool?

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/

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

whuang
Regular Contributor

Re: Is TC able to manipulate webpage by using browser developer tool?

Never mind, I sorted it out, should use contentDocument instead

View solution in original post

15 REPLIES 15
tphillips
Frequent Contributor

Re: Is TC able to manipulate webpage by using browser developer tool?

No TestComplete is not able to interact with the developer console.

 

What are you trying to do? We might be able to help you find a way without the developer console.


--------------------
Senior SQA Automation Engineer
whuang
Regular Contributor

Re: Is TC able to manipulate webpage by using browser developer tool?

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.

AlexKaras
Community Hero

Re: Is TC able to manipulate webpage by using browser developer tool?

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/

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

whuang
Regular Contributor

Re: Is TC able to manipulate webpage by using browser developer tool?

Thanks, I think this works

whuang
Regular Contributor

Re: Is TC able to manipulate webpage by using browser developer tool?

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.

Capture.PNG

whuang
Regular Contributor

Re: Is TC able to manipulate webpage by using browser developer tool?

Never mind, I figured it out.

whuang
Regular Contributor

Re: Is TC able to manipulate webpage by using browser developer tool?

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)

Marsha_R
Community Hero

Re: Is TC able to manipulate webpage by using browser developer tool?

What has changed since the last time the code worked?  Windows upgrades, browser upgrades, TestComplete upgrades, change in test environment?

 

 

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
whuang
Regular Contributor

Re: Is TC able to manipulate webpage by using browser developer tool?

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

cancel
Showing results for 
Search instead for 
Did you mean: