TestProject Forum
Powered by leading experts in the test automation community

Smart Test Recorder and Local Testing with Browserstack

Hello,

I’m trying to test my web application (hosted on an private server) on the Browserstack Cloud.

I recorded the test with the Smart Test Recorder and I want to avoid to work with the generated Code in VS Studio if possible to make the local testing work.

Thanks!

Regards,
Dennis

Hi Dennis, just to be on the same page with your scenario.

The web application you are trying to test is accessible from outside?
As long as it accessible from outside you can execute you recorded test on browser stack as is, no need to export it to code.

In case it doesn’t accessible from outside, you can utilize your TestProject agent , to test it on premise with your recorded test, in this case you don’t need to export anything to code as well :slight_smile:

hope it make sense…

Hey Mark,
the web application is not accessible from outside.

When I use my TestProject agent and then choose a Browserstack browser it also does not work. Browserstack screenshot shows “This site can’t be reached”.

Can someone help?

Hi Dennis, that makes sense if the application in not reachable from outside of your organization you can’t use Browserstack. In such case you can install additional TestPorject agent inside your organization on VM/another desktop/Docker. You can even create TestProject dockerized agent setup to run as part of your CI/CD: here is a quick tutorial for that https://hub.docker.com/r/testproject/agent

Thanks for your help. I’d like to try something else before:

You can configure your tests by adding some code for a local testing connection with browserstack (https://www.browserstack.com/local-testing/automate).

But unfortunately I can’t just export the recorded TestProject test to code and add the necessary code snippets from browserstack.

When I try to upload the edited code TestProject is saying this: “No CodedTests were found in assembly.”

So how can I do small edits to the gernerated Code and reupload it back to TestProject?

I’m not a developer and I just have little programming knowledge so I’d be happy about any help :slight_smile:

Hi Dennis.
After you download the generated code you can just add the code you want and upload it back.
You need our SDK and the path to the SDK in the build.gradle file, then you need to run the Gradle task Jar, and upload the Jar artifact you have in the build folder back to testproject as a coded test.


image

thanks ran.tzur,

I managed to edit the code and reupload it.

But following the steps on https://www.browserstack.com/local-testing/automate#supported I cant local test my web application through TestProject.

Has someone experience with local testing through TestProject?

In more detail:

I added following code to a simple Selenium test which navigates to my web application (not accessible from outside):

Snippet1
(Source: https://www.browserstack.com/automate/c-sharp#setting-local-tunnel)

With adding these capabilities to the RemoteWebDriver and setting up a local testing connection I can test my local web app.

How can I add this to my generetade (C#) Code from my TestProject Recorder Test without messing everything up?
Snippet2
I cant just replace the var driver = helper.Driver; from TestProject as the following driver actions wont work.

Thanks for your help so far!

@here,do we have any solution without messing TestProject driver, using BS driver…Thanks in advance!