Appium સર્વર સુધી મધ્યસ્થી દ્વારા પહોંચવા માટે, Python ની HTTP આદેશ ચેનલ ગોઠવો:

from appium import webdriver
from appium.webdriver.client_config import AppiumClientConfig
from selenium.webdriver.common.proxy import Proxy, ProxyType

route = Proxy()
route.proxy_type = ProxyType.MANUAL
route.http_proxy = 'http://proxy.example:8080'
route.ssl_proxy = 'http://proxy.example:8080'

config = AppiumClientConfig(
    remote_server_addr='https://appium.example',
    proxy=route,
)
driver = webdriver.Remote(
    options=device_options,
    client_config=config,
)

device_options એ એપ્લિકેશનનું હાલનું વિકલ્પ ઑબ્જેક્ટ છે. તેની ઉપકરણ/બ્રાઉઝર ક્ષમતાઓ રાખો અને હાલની પરીક્ષણ જીવનચક્ર દ્વારા driver.quit નું સંચાલન કરો.

AppiumClientConfig Selenium ના ClientConfig ને વારસામાં લે છે. મેન્યુઅલ પસંદગી HTTP સર્વર સરનામા માટે http_proxy અને HTTPS સરનામા માટે ssl_proxy વાપરે છે. અહીં મૂલ્યોમાં URL સ્કીમનો સમાવેશ થાય છે કારણ કે તે HTTP કનેક્શન મેનેજર ગોઠવે છે. માન્ય જાહેર માર્ગ દ્વારા પહોંચી શકાય તેવા Appium એન્ડપોઇન્ટ માટે, આ મૂલ્યો માટે HTTP પ્રોક્સી સૂચિમાંથી HTTP ઉમેદવાર પસંદ કરો.

સત્રની અંદર મોકલાયેલી પ્રોક્સી ક્ષમતા રિમોટ પર્યાવરણને તેનું પોતાનું ટ્રાફિક રૂટ કરવા કહે છે. તે Python ને અગાઉની સત્ર બનાવવાની વિનંતી સબમિટ કરવામાં મદદ કરી શકતી નથી. જરૂર પડે ત્યારે તે બીજો માર્ગ અલગથી ગોઠવો.

આ જાહેર ઇન્ટરફેસ આપતી સુસંગત Appium/Selenium જોડી વાપરો. સ્થાપિત remote_connection મોડ્યુલને પેચ કરવું આ ગોઠવણી માર્ગને બદલે જૂની ક્લાયન્ટ ગોઠવણોને લક્ષ્ય બનાવે છે.

સંબંધિત લેખો