ScreenshotNeo

BlogHow-to

How to Fix LambdaTest Screenshots Failing on an Indian Website with a Regional URL

A regional URL does not guarantee an India-based session. Check the URL, browser configuration, IP geolocation, Tunnel requirements, and screenshot result to isolate the failure.

By the ScreenshotNeo team4 October 20267 min read

A regional URL by itself does not make a LambdaTest screenshot session use an Indian IP address. First confirm the exact URL and supported browser, operating system, and resolution; then set India through LambdaTest’s geolocation control if the site chooses content by IP. For an automated Selenium session, set the geoLocation capability to IN. If the page is private and requires Tunnel, account for the provider’s documented limitation: Tunnel and geolocation cannot be used together in one Selenium test. Inspect the returned test and per-screenshot statuses before treating the issue as a rendering failure.

No URL, error message, test ID, or configuration was provided here, so the steps below diagnose likely causes rather than claim a specific failure was reproduced.

1. Record the failing request and result

Before changing settings, save the submitted URL exactly as sent, including scheme, regional hostname or path, query string, and redirects. Record the screenshot test ID, test status, screenshot status, OS, browser and version, and resolution. The screenshot result endpoint exposes these fields, making it possible to distinguish an invalid configuration or failed test from a completed capture that shows unexpected content. See the Automated Screenshot API documentation.

  • Copy the full URL from the request, not a manually reconstructed version.
  • Check that the URL is publicly reachable from the cloud session, or determine whether it requires authentication or a Tunnel.
  • Fetch the current available OS/browser combinations and resolutions instead of assuming an older example is still supported.
  • Keep a known-good control URL and run the same browser configuration against it.

2. Check the screenshot API configuration

For API-driven screenshot tests, use the documented screenshot service. The API expects a URL plus a configuration matrix and supports options such as deferred capture time, email notification, OS-specific resolutions, and browser selections. Use the live inventory endpoints because the available combinations can change. The following request is a runnable structural example; substitute an actual supported combination from the inventory response and your own regional URL.

export LT_USERNAME='YOUR_LAMBDATEST_USERNAME'
export LT_ACCESS_KEY='YOUR_LAMBDATEST_ACCESS_KEY'

curl --fail-with-body --user "$LT_USERNAME:$LT_ACCESS_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "url": "https://example.in/",
    "defer_time": 5,
    "email": false,
    "win_res": "1366x768",
    "configs": {
      "windows 10": {
        "chrome": ["74"]
      }
    }
  }' \
  'https://api.lambdatest.com/screenshots/v1/'

The browser and OS values above mirror the API documentation’s example format; query /os-browsers and /resolutions first, then replace them with combinations currently returned for your account. Do not infer that the example’s versions remain available.

curl --user "$LT_USERNAME:$LT_ACCESS_KEY" \
  'https://api.lambdatest.com/screenshots/v1/os-browsers'

curl --user "$LT_USERNAME:$LT_ACCESS_KEY" \
  'https://api.lambdatest.com/screenshots/v1/resolutions'

After the start request returns a test ID, retrieve its result and inspect both the overall test status and each screenshot status:

curl --user "$LT_USERNAME:$LT_ACCESS_KEY" \
  'https://api.lambdatest.com/screenshots/v1/YOUR_TEST_ID'

For each result, compare the submitted URL, OS, browser/version, resolution, status, and screenshot URL. A completed API test can still produce an unexpected page if the URL redirects, needs a session cookie, blocks the cloud request, or serves content by IP.

3. Set India geolocation when the site depends on IP

There are two different location signals to consider:

What the site checks What to configure What it affects
Visitor IP or server-side country lookup IP geolocation, country code IN The network IP location seen by the site
Browser or app location API Browser/device GPS location, where available Coordinates reported to the application
Regional hostname or URL path Submit the exact URL; add IP geolocation only if required URL routing, independent of the session’s network location

For an interactive screenshot session, choose India in the session’s geolocation control, then capture again. LambdaTest documents a country-selection control for screenshot testing. A URL such as https://in.example.com is only the destination; it is not evidence that the browser session itself is routed through India. See the provider’s screenshot geolocation instructions.

For automated Selenium tests, LambdaTest’s current capability documentation specifies the case-sensitive geoLocation capability and lists India as IN. Add it to your existing capabilities and retain the rest of your working browser configuration. The example below shows the relevant setting; use your project’s existing language binding and current hub configuration.

// Java Selenium capability fragment
MutableCapabilities capabilities = new MutableCapabilities();
capabilities.setCapability("browserName", "Chrome");
capabilities.setCapability("browserVersion", "latest");
capabilities.setCapability("platformName", "Windows 11");
capabilities.setCapability("geoLocation", "IN");

For the complete supported country list and capability details, use Selenium geolocation capabilities. The API-driven bulk screenshot endpoint and the Selenium capability flow are different workflows; do not assume a Selenium capability can simply be inserted into the bulk screenshot API JSON unless that API documents it.

4. Decide whether Tunnel is necessary

If the regional website is publicly accessible, retry without Tunnel first. A regional URL does not automatically require a Tunnel. If the site is behind a VPN, firewall, or local development environment, Tunnel may be necessary for reachability. LambdaTest’s geolocation capability page states that geolocation and Tunnel cannot be used together in a single Selenium test; the same guidance suggests running parallel tests when both conditions must be examined. A 2023 support response also described this constraint, so verify current product behavior if your workflow depends on it.

  1. Run the public URL with India geolocation and no Tunnel.
  2. Run the private URL with Tunnel and no geolocation.
  3. Compare whether the failure is reachability-related or country-dependent.
  4. If both private access and Indian IP behavior are essential, ask the provider about current supported architecture; do not assume one session can combine the controls.

Sources: current Selenium geolocation and Tunnel documentation and the dated LambdaTest support response.

5. Troubleshooting common failures

Symptom Likely cause What to try
India-specific content is missing The URL is regional, but the session IP is not in India. Set IP geolocation to IN, rerun, and compare with the same URL without geolocation.
Geolocation option is unavailable when Tunnel is active The provider documents Tunnel and geolocation as incompatible in one Selenium test. Run separate tests, one with Tunnel and one with geolocation; confirm current support with the provider.
Invalid location error Country code spelling or case is wrong, or the location is unsupported. Use the exact case-sensitive value IN and check the current supported-country list.
Test starts but a screenshot fails The requested browser/OS/resolution combination may not be valid, or the page load may fail. Query current inventory, reduce the matrix to one supported combination, and inspect each screenshot status.
Screenshot shows a login, error, or default page The page may need authentication, cookies, a permitted source IP, or the correct regional route. Open the exact URL from the cloud browser, test redirects, and use the API’s documented basic-auth or callback options where applicable.
Local or VPN-only URL cannot load The cloud browser cannot reach the private host directly. Configure Tunnel for reachability, then test geolocation separately because of the documented constraint.
Works once, fails intermittently Transient page-load, network, or upstream behavior can affect capture. Repeat a small controlled run, compare test and screenshot statuses, and avoid changing several variables at once.
API rejects the request Credentials, JSON, endpoint, or request configuration is invalid. Check HTTP status and response body, protect credentials in environment variables, and validate the JSON and endpoint against the current API documentation.

6. Make the diagnosis repeatable

  • Change one variable per run: URL, geolocation, Tunnel, or browser matrix.
  • Use a small browser matrix while debugging; expand it after one supported combination succeeds.
  • Keep the test ID and response JSON with the exact submitted URL and configuration.
  • Separate server-side IP behavior from browser GPS behavior; changing one does not establish the other.
  • When a capture fails, distinguish the overall job status from individual screenshot statuses.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request captures a URL as an image or PDF; see the API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://example.in/ \
  -o shot.webp
import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://example.in/"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://example.in/'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('shot.webp', res);
  • Cookie banners are accepted and removed, and known consent platforms, newsletter popups, and chat widgets are removed before capture; each step can be turned off.
  • Bot checks, blank pages, timeouts, failed loads, and cache hits are never billed. Response headers state the page verdict and billing result.
  • An MCP server gives AI agents tools to take screenshots, inspect page information, and capture PDFs.
  • 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000 screenshots. All listed features are available on every plan.

Start with 1,000 free screenshots a month; no card required.

FAQ

Does a regional URL make LambdaTest use an Indian IP?

No. The hostname or path selects a URL route; use IP geolocation when the server chooses content from the visitor’s IP.

Is India geolocation the same as setting GPS coordinates?

No. IP geolocation affects the network origin seen by the server. GPS or browser location supplies coordinates to location-aware application code.

Can I use Tunnel and India geolocation together?

LambdaTest documentation says not in one Selenium test. Run separate tests for private reachability and country routing, and confirm current behavior if that constraint affects your setup.

Which ID should I save for debugging?

For the automated screenshot API, save the returned test ID and use it to fetch the test and per-screenshot details.