I have set up Jenkins n configured windows agent to Jenkins. I have maximized the size of windows agent. when I trigger the execution of robot scripts from jenkind, test cases are running in headless mode n test case are failing as it is not able to find the locators. when i checked the logs i see that chrome is not opened in maximized mode. can any body give me solution how to fix this issue.
There are multiple points here apart from @falcon030 useful question
Maximize size in Jenkins is for the running system/agent, not chrome. Keywords like " Maximize Browser Window" in Seleniumlibrary does it.
Headless means no GUI, so you need to set window or browser size through your library keywords on RF to match what your expecting, to avoid interaction issues.
Use of Selenium or Browser library is not related to windows size setting. Both libraries will provide possibility to set this.
Choice between them is rather linked to your app design, RF and tests needs… You can find infos on pros and cons here or on the web, I think the main consideration is when you start your project with a library, later switch is possible but may take some work.
Anyway you can do something like this with Seleniumlibrary:
*** Test Cases ***
Open Browser url chrome
Set Window Size 1920 1080
Maximize Browser Size
Wait Until Element Is Visible xpath=//button[@id='my-button']
Click Element xpath=//button[@id='my-button']
Capture Page Screenshot