Reputation: 33
The general structure is Selenium and Jenkins integration.
In Jenkins, I have a Windows slave node, and then build the project in the Jenkins master node, let Selenium in the slave node Windows Server running in the background.
The results showed that after running the case, there are a lot of error, showing elements are not visible, after the screenshot, I found the window is 1024 * 663, not the expected 1920 * 1080, so do not drag the scroll bar, a lot of elements cannot click.
How to modify the window to the maximum?
My Chrome version: 62, Python version: 3.6, Selenium: 3.
driver.maximize_window ()
options.add_argument("--start-maximized")
Have tried, no luck.
Upvotes: 3
Views: 8441
Reputation: 6459
Try the following code:
driver.set_window_size(1920, 1080, driver.window_handles[0])
Hope it helps you!
Upvotes: 10