Opening Chrome browser session in RobotFramework 7 is taking 5 mins, So, we need to find the issue in this keyword and optimize it as ideally it should take a few seconds to open the URL in Browser.
i have tried with multiple versions of Chrome and Chromedriver and the compability is fine, as it works in RF version 3.
Irrespective of the chrome versions and irrespective of the VM, seeing this issue.
Below is the keyword snippet
${OPEN URL IN BROWSER TIMEOUT} 60s #Time out value needed in order for a link to open in browser
${OPEN URL IN BROWSER INTERVAL} 15s #Time interval needed in order for a link to open in browser
.......
.......
Open URL In Browser
[Arguments] ${url} ${browser} ${headless flag}=False
${chrome_options} = Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Run Keyword If '${headless flag}' == 'True' Call Method ${chrome_options} add_argument headless
Call Method ${chrome_options} add_argument disable-gpu
${chrome_version} Run google-chrome --version | awk '{print$5}'
Call Method ${chrome_options} add_argument --user-agent=Chrome/${chrome_version} System/ComputerId
Call Method ${chrome_options} add_argument start-maximized
Call Method ${chrome_options} add_argument --window-size=1920,1080
Call Method ${chrome_options} add_argument --incognito
Call Method ${chrome_options} add_argument --test-type
Call Method ${chrome_options} add_argument --no-sandbox
Call Method ${chrome_options} add_argument --ignore-certificate-errors
Call Method ${chrome_options} add_argument --disable-dev-shm-usage
${options}= Call Method ${chrome_options} to_capabilities
Wait Until Keyword Succeeds ${OPEN URL IN BROWSER TIMEOUT} ${OPEN URL IN BROWSER INTERVAL} Open Browser ${url} browser=${browser} options=${chrome_options}
Robot debug LOG:
2024-06-20 11:25:09.079157 – INFO – +—- START KEYWORD: BuiltIn.Wait Until Keyword Succeeds [ ${OPEN URL IN BROWSER TIMEOUT} | ${OPEN URL IN BROWSER INTERVAL} | Open Browser | ${url} | browser=${browser} | options=${chrome_options} ]
2024-06-20 11:25:09.079892 – INFO – +—– START KEYWORD: SeleniumLibrary.Open Browser [ ${url} | browser=${browser} | options=${chrome_options} ]
2024-06-20 11:25:09.080411 – DEBUG – Test timeout 30 minutes active. 1783.012 seconds left.
2024-06-20 **11:25:09.080732 **- INFO – Opening browser ‘Chrome’ to base url ‘https://100.78.142.56:30008’.
2024-06-20 11:30:11.059438 – DEBUG – Opened browser with session id 9ca994124566f2cf5094ea9bc3d385d4.
2024-06-20 11:30:11.059871 – INFO – +—– END KEYWORD: SeleniumLibrary.Open Browser (301.979979 s)
2024-06-20 11:30:11.060113 – INFO – +—- END KEYWORD: BuiltIn.Wait Until Keyword Succeeds (301.980956 s)
2024-06-20 11:30:11.060332 – INFO – +— END KEYWORD: testkeywords.Open URL In Browser (302.035011 s)
Time taken to execute this keyword is always 5 mins – 11:30-11:25
Can anyone please help identify and fix this issue in RobotFramework 7 (Python 3.12.2) ?
Tried with below versions:
$ python3 -c “import selenium; print(selenium.version)”
4.21.0
- $ **chromedriver **–version
ChromeDriver 103.0.5060.134 (8ec6fce403b3feb0869b0732eda8bd95011d333c-refs/branch-heads/5060@{#1262})
$ google-chrome –version
Google Chrome 103.0.5060.114
2.# **chromedriver **–version
ChromeDriver 125.0.6422.141 (4b1e83937122185343ba92e909b021f307c719ca-refs/branch-heads/6422@{#1186})
#google-chrome –version
Google Chrome 125.0.6422.141
-
- ChromeDriver Version: 124.0.6367.8
- Google Chrome Version: 124.0.6367.8
stack-fan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.