{"id":23235764,"url":"https://github.com/billmeyer/verify-sauce-connect","last_synced_at":"2025-04-05T20:34:51.347Z","repository":{"id":89566505,"uuid":"123967386","full_name":"billmeyer/verify-sauce-connect","owner":"billmeyer","description":"Sample Application to test connectivity via Sauce Connect to the Sauce Labs cloud.","archived":false,"fork":false,"pushed_at":"2018-11-05T14:21:11.000Z","size":221,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-11T20:57:36.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/billmeyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-05T19:22:15.000Z","updated_at":"2019-05-12T18:35:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9a6d6ac-1be5-4dbb-805a-f3f709beeea0","html_url":"https://github.com/billmeyer/verify-sauce-connect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billmeyer%2Fverify-sauce-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billmeyer%2Fverify-sauce-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billmeyer%2Fverify-sauce-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billmeyer%2Fverify-sauce-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/billmeyer","download_url":"https://codeload.github.com/billmeyer/verify-sauce-connect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399889,"owners_count":20932876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-19T03:29:30.069Z","updated_at":"2025-04-05T20:34:51.328Z","avatar_url":"https://github.com/billmeyer.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Verify Sauce Connect\n\nThis sample project can be used as a starting point for testing connectivity from the Sauce Labs cloud to your private network via Sauce Connect.\n\n## Getting Started\n\n### Prerequisites\n\nFollow the instructions located at https://wiki.saucelabs.com/display/DOCS/Basic+Sauce+Connect+Proxy+Setup.  Most importantly, this link will provide instruction for:\n\n * Whitelisting the appropriate IP address ranges for the Sauce Cloud,\n * Downloading the most current release of Sauce Connect.\n \nOnce the IP white lists are put in place and Sauce Connect is downloaded, proceed to the next section.  \n\n### Start Sauce Connect for accessing Desktop VMs, Emulators and Simulators\n\nThis section walks you through the steps to start the Sauce Connect proxy for connections to Desktop VMs, Emulators, and Simulators.  Real Device access requires a separate method for starting Sauce Connect described in the next section.\n    \n1. Start the Sauce Connect proxy for Desktop VMs, Emulators, and Simulators\n\n    To start the Sauce Connect proxy, use the following command:\n\n    ```\n    $ sc --user=${SAUCE_USERNAME} --api-key=${SAUCE_ACCESS_KEY} --tunnel-identifier mytunnel1\n    ```\n\n    where:\n    \n    * `${SAUCE_USERNAME}` is the username (or email address) used to sign into the Sauce Labs dashboard at https://saucelabs.com.\n    * `${SAUCE_ACCESS_KEY}` is the access key.  This can be found by signing into https://saucelabs.com, clicking on your user name in the top right corner, selecting __My Account__.  The __Access Key__ is found about half way down the web page,\n    * `mytunnel1` is a user-friendly name to give the tunnel.\n\n2. Wait for Sauce Connect to completely start\n\n    The Sauce Connect start up will be complete when you see `Sauce Connect is up, you may start your tests.` in the output:\n\n    ```\n    $ sc --user=${SAUCE_USERNAME} --api-key=${SAUCE_ACCESS_KEY} --tunnel-identifier mytunnel1\n    5 Mar 13:10:49 - Sauce Connect 4.4.12, build 3905 74cd761 -dirty\n    5 Mar 13:10:49 - Using CA certificate bundle /etc/ssl/certs/ca-bundle.crt.\n    5 Mar 13:10:49 - Using CA certificate verify path /etc/ssl/certs.\n    5 Mar 13:10:49 - Starting up; pid 6199\n    5 Mar 13:10:49 - Command line arguments: sc ...\n    5 Mar 13:10:49 - Log file: /tmp/sc.log\n    5 Mar 13:10:49 - Pid file: /tmp/sc_client.pid\n    5 Mar 13:10:49 - Timezone: CST GMT offset: -6h\n    5 Mar 13:10:49 - Using no proxy for connecting to Sauce Labs REST API.\n    5 Mar 13:10:54 - Started scproxy on port 38195.\n    5 Mar 13:10:54 - Please wait for 'you may start your tests' to start your tests.\n    5 Mar 13:11:16 - Secure remote tunnel VM provisioned.\n    5 Mar 13:11:16 - Tunnel ID: 105bb7fcf311480791289f85186b1d01\n    5 Mar 13:11:16 - Using no proxy for connecting to tunnel VM.\n    5 Mar 13:11:16 - Starting Selenium listener...\n    5 Mar 13:11:16 - Establishing secure TLS connection to tunnel...\n    5 Mar 13:11:16 - Selenium listener started on port 4445.\n    5 Mar 13:11:17 - Sauce Connect is up, you may start your tests.\n    ```     \n\n### Start Sauce Connect for accessing Real Devices (mobile)\n\nThis section walks you through the steps to start the Sauce Connect proxy for connections to the Real Device cloud.\n\n1. Start the Sauce Connect proxy for Real Device (mobile):\n\n    To start the Sauce Connect proxy, use the following command:\n\n    ```\n    $ sc --user=${RDC_USERNAME} --api-key=${RDC_SAUCE_CONNECT_API_KEY} --tunnel-identifier ${RDC_TUNNEL_ID} --rest-url=https://us1.api.testobject.com/sc/rest/v1\n    ```\n\n    where:\n    \n    * `${RDC_USERNAME}` is the username (or email address) used to sign into the TestObject dashboard at https://app.testobject.com.\n    * `${RDC_SAUCE_CONNECT_API_KEY}` is the access key.  This can be found by signing into https://app.testobject.com, clicking on __Account__ in the top right corner, selecting __Account Settings__ \u0026rarr; __Sauce Connect__.  Copy the __API Key__ value,\n    * `mytunnel1` is a user-friendly name to give the tunnel.\n\n    NOTE: The __${RDC_SAUCE_CONNECT_API_KEY}__ is the __API Key__ used by the __Sauce Connect__ proxy.  It is **not** the same API Key used by your applications.\n\n2. Accept the Sauce Connect disclaimer\n\n    As one-time task, you must accept the __Sauce Connect for Public Cloud__ disclaimer found under the __SAUCE CONNECT__ tab of your __Account Settings__.  To do so, sign into https://app.testobject.com, click on __Account__ in the top right corner, selecting __Account Settings__ \u0026rarr; __Sauce Connect__.  At the bottom of the screen, you will to click the __Enable Sauce Connect for Public Cloud__ button.\n\n3. Wait for Sauce Connect to completely start\n\n    The Sauce Connect start up will be complete when you see `Sauce Connect is up, you may start your tests.` in the output:\n\n    ```\n    $ sc --user=${RDC_USERNAME} --api-key=${RDC_SAUCE_CONNECT_API_KEY} --tunnel-identifier ${RDC_TUNNEL_ID} --rest-url=https://us1.api.testobject.com/sc/rest/v1\n    3 Jul 09:07:19 - Sauce Connect 4.4.12, build 3905 74cd761 -n -dirty\n    3 Jul 09:07:19 - Using CA certificate verify path /etc/ssl/certs.\n    3 Jul 09:07:19 - Starting up; pid 11674\n    3 Jul 09:07:19 - Command line arguments: ./sc ...\n    3 Jul 09:07:19 - Log file: /var/folders/xn/6l1n3sqj3ylcvwbjftq_yrt00000gn/T/sc-my-rdc-tunnel.log\n    3 Jul 09:07:19 - Pid file: /tmp/sc_client-my-rdc-tunnel.pid\n    3 Jul 09:07:19 - Timezone: CDT GMT offset: -5h\n    3 Jul 09:07:19 - Using no proxy for connecting to Sauce Labs REST API.\n    3 Jul 09:07:19 - Error in checkUpdate: error querying from https://us1.api.testobject.com/versions.json, error was: \u003chtml\u003e\u003cbody\u003e\u003ch1\u003e503 Service Unavailable\u003c/h1\u003e\n    No server is available to handle this request.\n    \u003c/body\u003e\u003c/html\u003e\n    . HTTP status: 503 Service Unavailable\n    3 Jul 09:07:19 - Started scproxy on port 49383.\n    3 Jul 09:07:19 - Please wait for 'you may start your tests' to start your tests.\n    3 Jul 09:07:25 - Secure remote tunnel VM provisioned.\n    3 Jul 09:07:25 - Tunnel ID: 174c348f-83fa-4d11-bb82-04c2e51096f5\n    3 Jul 09:07:25 - Using no proxy for connecting to tunnel VM.\n    3 Jul 09:07:25 - Starting Selenium listener...\n    3 Jul 09:07:25 - Establishing secure TLS connection to tunnel...\n    3 Jul 09:07:25 - Selenium listener started on port 4445.\n    3 Jul 09:07:35 - Sauce Connect is up, you may start your tests.\n    ```    \n\n    NOTE: The error `Error in checkUpdate: error querying from https://us1.api.testobject.com/versions.json ...` can be ignored and will be removed from the next release of Sauce Connect.\n\n### Verify Connectivity with a Sample Web App and Live Testing\n\nThis git repo contains a sample web application that can be used to verify connectivity from the device under test on the Sauce Cloud to your private network where the Sauce Connect proxy is running.\n\nTo verify Sauce Connect using this sample web app, follow these steps:\n\n1. Package the sample web app into a .war file:\n\n        $ mvn clean install -DskipTests=true\n \n2. Start the include sample website that will be used to test connectivity from Sauce Labs to this network segment:\n\n        $ mvn org.codehaus.cargo:cargo-maven2-plugin:run\n\n3. Verify Connectivity.\n\n    * To verify connectivity from Desktop VMs, Emulators, and Simulators, sign into https://saucelabs.com and start a **Live Testing** session.  \n\n    * To verify connectivity from the Real Device cloud, sign into https://app.testobject.com, create a Web-based Mobile App supplying the URL of the hostname you wish test and start a **Live Testing** session.\n        NOTE: Be sure to select your tunnel instance in the __Sauce Connect Tunnel__ dropdown.\n\n4. Navigate to your hostname and this specific URI:\n\n    ```\n        http://\u003cyourhostname\u003e:8080/verify-sauce-connect\n    ```\n    \n    ![](result.png)\n\n### Verify Connectivity with a Sample Web App and Automated Testing\n\nTo enable your test suite to use the Sauce Connect tunnel instance, a capability named `tunnelIdentifier` needs to be added to your Desired Capabilities specifying the tunnel identifier specifyed when starting the tunnel.  In the example above, we specifed a tunnel ID of `mytunnel1`.\n\nHere's an example from the test suite included in this git repo: \n\n```Java\n    capabilities.setCapability(\"tunnelIdentifier\", sauceTunnelId);\n```\n\nSee `src/test/java/com/saucelabs/example/VerifySauceConnectTest.java` for more details.\n\n#### Executing the automated test suite\n\nOur test suite requires a few inputs so it can a) know the tunnel ID we want to use and b) know the hostname and port number of the internal host where our sample web site is running.  We can supply these to the test suite via the following environment variables:\n\n* SAUCE_TUNNEL_ID - The tunnel ID we wish to use.  In these example, we've been using `mytunnel1`\n* INTERNAL_TEST_HOST - Specify the hostname where our sample maven project is downloaded and running in step 2 above.  Defaults to `localhost`\n* INTERNAL_TEST_PORT - The port our sample website is listening on.  Defaults to `8080`\n\nOnce these environment variables are set, we can execute our test suite:\n\nThe sample test suite can be executed with:\n\n```\n    $ mvn test\n```\n\n```\n[INFO] Scanning for projects...\n[INFO]\n[INFO] ------------------------------------------------------------------------\n[INFO] Building Verify Sauce Connect Utility 1.0.0\n[INFO] ------------------------------------------------------------------------\n[INFO]\n[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ verify-sauce-connect ---\n[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!\n[INFO] skip non existing resourceDirectory /Volumes/Duo1/github/billmeyer/verify-sauce-connect/src/main/resources\n[INFO]\n[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ verify-sauce-connect ---\n[INFO] Nothing to compile - all classes are up to date\n[INFO]\n[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ verify-sauce-connect ---\n[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!\n[INFO] skip non existing resourceDirectory /Volumes/Duo1/github/billmeyer/verify-sauce-connect/src/test/resources\n[INFO]\n[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ verify-sauce-connect ---\n[INFO] Nothing to compile - all classes are up to date\n[INFO]\n[INFO] --- maven-surefire-plugin:2.20.1:test (default-test) @ verify-sauce-connect ---\n[INFO]\n[INFO] -------------------------------------------------------\n[INFO]  T E S T S\n[INFO] -------------------------------------------------------\n[INFO] Running com.saucelabs.example.VerifySauceConnectTest\nJun 26, 2018 2:35:57 PM org.openqa.selenium.remote.ProtocolHandshake createSession\nINFO: Detected dialect: OSS\n[main][String] Tue Jun 26 14:35:57 CDT 2018SauceOnDemandSessionID=f54578acd72d43c9aca4c2492a6d7a63\nWe successfully accessed our internal test page!\n[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 25.428 s - in com.saucelabs.example.VerifySauceConnectTest\n[INFO]\n[INFO] Results:\n[INFO]\n[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0\n[INFO]\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD SUCCESS\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time: 27.057 s\n[INFO] Finished at: 2018-06-26T14:36:02-05:00\n[INFO] Final Memory: 19M/773M\n[INFO] ------------------------------------------------------------------------\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillmeyer%2Fverify-sauce-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbillmeyer%2Fverify-sauce-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillmeyer%2Fverify-sauce-connect/lists"}