This is Definitive Guide to the Local testing on cloud servers. I am pretty sure that I will answer your all the questions and you will have a clear knowledge and help you become an expert.
You must be asking…
What is Local Testing?
What is Local Testing?
Local Testing means that Test your web application on the internal servers, private servers or Staging environments on the cloud providers. like saucelabs.com, browserstack.com or cross-browser testing.com like tools.
Most of the time,
QA members have to test the staging servers which are only available through local mapping in their Host file.
In fact:
These web application files like HTML, CSS, and JavaScript files are not accessible over the internet and mainly blocked by VPN, firewalls.
Why this is important or required?
In my QA career,
It was a common scenario that we need to test AUT(application user testing) a Staging server as Local Testing daily.
- Nobody Test in Production servers.
- With the Staging servers(on local testing), We can catch the early bugs.
- Beta Mobile Apps or Web application are always on Stag or Private servers.
- To Map folders like Localhost, Private or internal server, HTTPS or HTTP, Subdomains, HTML design folders extra.
Therefore: The real question is How to do the Local Testing ?
How to do it?
There are multiple tools available online to do Local Testing on the different Cloud providers. We can do the Functional and API testing within the Local Testing using these tools also.
Below is the list of Tool that I have used and explained them in few sentences.
Local Testing of Web application on Browserstack
Here’s the step-by-step process:
Suppose I have an app running at https://localhost:3000 that I want to test on the different Cross browsers(Chrome, Firefox) on BrowserStrack.
1. First Way – for Chrome only Browser : –
It is quite easy, You need to download a Chrome extension of Browserstack which basically passes you local machine data to Browserstack and provides the complete mapping experiences.
Make sure you check the checkbox that. “Resolve all URLs through my network” for better results.
As per browser stack –
3. Using Local Testing binary ( as Commandline) for Automation.
Here’s the step-by-step process:
Suppose you need to run a Test with automation on browser stack. You can leverage command line utility.
Run the Browserstack command line tool and it will pass your automation test cases to browser stack from Local machine for Local testing.
Download the appropriate binary:
You can use the following command – h, –help for more help.
Start the command line utility and run your cases.
When using the command line to enable Local Testing, specify the folder with the –folder parameter to test the local folder.
Example:
On MacOs
1 | ./BrowserStackLocal --key tKUJCMyG7WZ5yUJsaSFd --folder /Users/test/mywebapp |
On Windows
1 | BrowserStackLocal.exe --key tKUJCMyG7WZ5yUJsaSFd |
Note: Now the Local folders can be tested alongside private and internal servers using the dashboard.
You can leverage the Proxy command line options also if you are behind the proxy
1 | ./BrowserStackLocal --key tKUJCMyG7WZ5yUJsaSFd--folder /Users/test/mywebapp --proxy-port <proxy_port> |
1 | ./BrowserStackLocal --key tKUJCMyG7WZ5yUJsaSFd --local-proxy-host <browsermob_proxy_host> --local-proxy-port <browsermob_proxy_port> --local-proxy-user <proxy_username> --local-proxy-pass <proxy_password> |
Also, you can leverage the:-
1 | --force-local |
options in the command line to do Force fully Local testing.
More information at . – https://www.browserstack.com/local-testing
Local Testing of Web application on SauceLab?
Here’s the step-by-step process:
Sauce Lab offers a Proxy command line tool that you can leverage to do the Local Testing.
First, download the proxy server for your platform here: https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+Proxy.
Navigate to the folder and run in command line.
1 | \sc -u sauceuser -k youraccesskey |
When you have the proxy server is up and running, you should see the tunnel as an option when running manual tests.
Now you can test your local servers with a multitude of browsers! Enjoy…..
Local Testing of Web application on Cross browser testing(Tool)?
CrossBrowser Testing.com also allows us to do Local testing with Chrome extension and To install, go the Test Center in Chrome and click “Local Connection” in the top right.
After that, you need to download the Mac CBTLocalInstaller.dmg or Windows app CBTLocalInstaller.exe.
Ready?
Now the Local Connection window will then ask you to verify your local app installation. Simply click “Verify.” After successful verification, you are ready to use the CBT Local Connection Extension!
How to do Local Testing of the Web application(API Testing) on Runscope?
What is Runscope ?
It is an awesome tool that allows you to do the API Testing and monitoring.
There are some cases, you require to do the API Testing of your Private, Local or Staging servers by sending API request from the private server to runscope servers to Test other locations or output.
We can use the Runscope On-Premises Agent that can run on your local machine and executes requests in the location that makes the most sense for your infrastructure, all while keeping your test management in the cloud.
Step 1 – Download the Runscope Radar – https://www.runscope.com/docs/api-testing/agent/
Step 2 – It’s again a command line tool that can be run using a conf file stored in the same dir you are running the agent. (Config can be download in run scope environment)
1 | ./runscope-radar -f radar.conf |
Step 3 – After that make sure you switch on the Agent to Stag. servers in the Runscope Dashboard.
You can use the command line option -h, –help to get more details in radar.
Conclusion
Now you know,
How you can we leverage the Browserstack, SauceLab, CrossBroser Testing & Runscope to perform Functional and API Testing on the local environment. Right?
This is like an Ultimate cheat sheet for Local Testing with every bit that I learned over course of time.
Please share and comment if you have doubt.
Over to you…