Chrome option

This commit is contained in:
2025-11-20 12:19:49 +01:00
parent 9c49580fd6
commit e53169a88c

View File

@@ -5,24 +5,11 @@ Resource ../FrontOffice/FrontOfficeA
*** Variables ***
${BROWSER} chrome
${CHROME OPTIONS} add_argument("--headless=new");add_argument("--disable-dev-shm-usage");add_argument("--no-sandbox");add_argument("--window-size=1920,1080")
*** Keywords ***
Begin Web Test
# Crée un objet ChromeOptions
${options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
# Tous les arguments en positionnel
Call Method ${options} add_argument --headless
Call Method ${options} add_argument --disable-dev-shm-usage
Call Method ${options} add_argument --no-sandbox
# ⚠️ ICI : on cache le '=' dans une variable, comme ça Robot ne le voit pas
${win_arg}= Set Variable --window-size=1920,1080
Call Method ${options} add_argument ${win_arg}
# Utilise le chromedriver installé dans le LXC Jenkins
Create Webdriver Chrome executable_path=/usr/local/bin/chromedriver options=${options}
Open Browser about:blank ${BROWSER} options=${CHROME OPTIONS}
Set Selenium Speed 0.3s
Set Selenium Timeout 7s