Hi, im trying to open a mobile emulation using robot for a school project but all my codes just start the emulation and instantly close the browser,
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def Mobile_Browser_Driver():
mobile_emulation = {
"deviceMetrics": { "width": 360, "height": 640, "pixelRatio": 3.0 },
"userAgent": "Chrome (Windows; Android 4.2.1; en-us; Nexus 5 Chrome/18.0.1025.166 Mobile" }
chrome_options = Options()
chrome_options.add_experimental_option("mobileEmulation", mobile_emulation)
driver = webdriver.Chrome(chrome_options = chrome_options)
can u help me pls?
i trying your code but the Log send me the next error "global name 'BuiltIn' is not defined"
I appreciate your given time and attention