cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing files downloaded by automated test running in CBT browser

SOLVED
Highlighted
New Contributor

Accessing files downloaded by automated test running in CBT browser

I have a few automated tests (Java based webdriver) that cause my application under test to generate a pdf and download it.  Next, the test picks up the file and parses it to make sure the content in the pdf was created in the expected manner.  When I run these tests on my local network, I download the files into a folder that is accessible to all machines within our network so that whatever machine kicked off the test can also find the file for parsing.  When I run these tests on CBT, I don't have that luxury.  Is there a way to send the downloaded file back through the tunnel to my local network for parsing?  I'm not seeing anything in the API to support that functionality.

1 ACCEPTED SOLUTION

Accepted Solutions
New Contributor

Re: Accessing files downloaded by automated test running in CBT browser

I know it's been a while since I posted this question, but as requested here is what finally worked for me.  

 

1.  I start up an HttpsServer with a context that allows me to upload a file to the shared directory on my internal network.

2.  I download the file in the browser on my CBT machine.

3.  I hit the URL of my server from my CBT machine using local in the URL (i.e. https://local: port/uploadForm) and specify the downloaded file in the web form I created for the server context.

4.  The file is uploaded to my local network and is now available for parsing, so I kill the HttpsServer.

 

The code is a little too much for a forum post, but if requested I may be able to throw together a sample java project with all the requisite pieces.  Just wanted to let the 2 or 3 other people in the world who might want to try this know that it's possible!

 

5 REPLIES 5

Re: Accessing files downloaded by automated test running in CBT browser

Hi,

 

Unfortunately, it's impossible to get a file from CBT. So, such a test cannot be executed in CBT. 

Regards,
Yuriy Peshekhonov
Customer Care Engineer
Community Hero

Re: Accessing files downloaded by automated test running in CBT browser

@dsaner
Hi,

 

Not sure about webdriver (I understand it as Selenium), but documentation for TestComplete says that it is possible from CBT to work with resources from the local network via http:// and file:/// protocols (https://support.smartbear.com/testcomplete/docs/working-with/integration/cbt/preparing/tests-with-lo...).

Also, there is description how to open (multiple) CBT tunnels using Java/NodeJS (https://support.smartbear.com/testcomplete/docs/working-with/integration/cbt/local-connections.html, last section of the topic).

Far not sure, but maybe the above will inspire you with some good ideas...

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
New Contributor

Re: Accessing files downloaded by automated test running in CBT browser

Yep, it's Selenium.  I've been playing around with some of the ideas mentioned in your links.  I think I should be able to use the file:/// method to get a workaround going.  Thanks for the input!

Community Hero

Re: Accessing files downloaded by automated test running in CBT browser

Fingers crossed Smiley Happy

 

If you don't mind, I'll appreciate it if you update this thread with the results (either positive or not) for the benefit of others...

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
New Contributor

Re: Accessing files downloaded by automated test running in CBT browser

I know it's been a while since I posted this question, but as requested here is what finally worked for me.  

 

1.  I start up an HttpsServer with a context that allows me to upload a file to the shared directory on my internal network.

2.  I download the file in the browser on my CBT machine.

3.  I hit the URL of my server from my CBT machine using local in the URL (i.e. https://local: port/uploadForm) and specify the downloaded file in the web form I created for the server context.

4.  The file is uploaded to my local network and is now available for parsing, so I kill the HttpsServer.

 

The code is a little too much for a forum post, but if requested I may be able to throw together a sample java project with all the requisite pieces.  Just wanted to let the 2 or 3 other people in the world who might want to try this know that it's possible!

 

New Here?
Join us and watch the welcome video:
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win