Java runner → configured proxy → WebDriver service
remote browser → its own route → website

প্রথম পথের জন্য Java command executor কনফিগার করুন:

import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URI;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.HttpCommandExecutor;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.http.ClientConfig;

var proxy = new Proxy(Proxy.Type.HTTP,
    new InetSocketAddress("proxy.example", 8080));
var config = ClientConfig.defaultConfig()
    .baseUri(URI.create("https://grid.example/"))
    .proxy(proxy);
var executor = new HttpCommandExecutor(config);
var driver = new RemoteWebDriver(executor, new ChromeOptions());

স্থাপিত পথসহ প্রকৃত Grid endpoint ব্যবহার করুন। প্রয়োজনীয় Chrome বিকল্প রাখুন এবং driver.quit() দিয়ে সেশন শেষ করুন।

এটি Java প্রোগ্রামের HTTP সংযোগের জন্য java.net.Proxy। Selenium-এর org.openqa.selenium.Proxy capability বরং ব্রাউজারের পাতার ট্রাফিক নিয়ন্ত্রণ করে; দ্বিতীয় পথেও প্রক্সি লাগলেই কেবল সেটিও ব্যবহার করুন।

সেশন তৈরি বা কমান্ড পাঠানোর ব্যর্থতা প্রথম পথের সমস্যা। পরের নেভিগেশন দ্বিতীয় পথে ব্যর্থ হতে পারে। Java প্রোগ্রামের মধ্যস্থতাকারীর প্রমাণীকরণের জন্য ওই HTTP পরিবহন সমর্থিত পদ্ধতি লাগে; ব্রাউজারের প্রমাণীকরণ callback তা কনফিগার করে না।

সম্পর্কিত নিবন্ধ