Forum Discussion
Hi,
Once again in order to double-check:
Do you *really* need to send *different* files from your test? Won't sending of the same file work?
Hi Alex,
I apologize for not having explicitly stated that yet. The answer is: Yes, I would like to send a screenshot directly from the respective CrossBrowserTesting machine in certain situations, for example (but not only) in case of an error during testing. And I don't want to have to wait until the log data has finally landed on the local computer after completing all assigned test runs on all the CBT machines concerned (which can take several hours).
Thanks + best regards
- AlexKaras8 years ago
Champion Level 1
Hi,
Then, considering that TC 12.4 and up supports external project files (https://support.smartbear.com/testcomplete/docs/general-info/version-history/features-added-to-ver-12-4.html#smarter-crossbrowsertesting-integration), I would stick to Helen's suggestion: add curl files to some subfolder of your test project so that they are deployed to CBT and use it (curl) to send the screenshot.
https://support.smartbear.com/testcomplete/docs/reference/program-objects/picture/savetofile.html describes how to save the screenshot to the file.
- TestKeks8 years agoOccasional Contributor
Hi Alex,
> Then, considering that TC 12.4 and up supports external project files (https://support.smartbear.com/testcomplete/docs/general-info/version-history/features-added-to-ver-12-4.html#smarter-crossbrowsertesting-integration), I would stick to Helen's suggestion: add curl files to some subfolder of your test project so that they are deployed to CBT and use it (curl) to send the screenshot.
That almost sounds too good to be true. In this respect, I would understand the Release Notes to mean that it is possible to use your stored test data in this way, for example. Don't you think SMARTBEAR would have made it even clearer if Windows applications could suddenly be run on cloud machines? Which keyword operation or scripting method would I use to verify this approach? Is there a way to do this that works without the TestComplete Desktop module, i. e. only with the Web module?
Edit 1: As I just saw, Helen recommended in her post above to call curl with the WshShell.run method. Should this work without a Desktop module?
Edit 2: And once again in order to double-check: Is there no way to extract these original, unaltered, i. e. not encoded, non-human readable control characters that make up my screenshot graphics file, so that I can concatenate the data myself in the required multipart/form-data format? The rest of the Javascript needed for this task I have finished long ago, and of course it works - only this darned binary data is missing.
Thanks + best regards
- AlexKaras8 years ago
Champion Level 1
Hi,
> if Windows applications could suddenly be run on cloud machines?
Considering that your tests are running under TestExecute on the cloud machines, it is my expectation that some Windows environment is provided for TestExecute and thus, processes that are spawned from the test must be able to run in this environment.
The simplest check, probably, would be to copy some file into some subfolder of the test project and add a test (code or keyword) that will check if the file exists in this subfolder. Deploy and run this test into CBT and check if the file was found.
> the WshShell.run method. Should this work without a Desktop module?
Not sure, you should check. But in the worst case, WshShell is just a wrapper and you always should be able to use native JScript's
var objShell = new ActiveXObject("Wscript.Shell"); objShell.exec("curl ...");
> Is there no way to extract these original, unaltered, i. e. not encoded, non-human readable control characters that make up my screenshot graphics file
Try ADODB.Stream:
http://www.motobit.com/tips/detpg_post-binary-data-url/