I cant set property with a System.setProperty
System.setProperty("selenide.browserSize", "300x200");
After this command browserSize is not changed
试试这个作为Maven参数
-Dselenide.browserSize=300x200
You can use Selenide build in Configurations. Import for Configurations:
import com.codeborne.selenide.Configuration;
Configurations to run Chrome:
System.setProperty("webdriver.chrome.driver", ".\\chromedriver.exe");
Configuration.browser = "chrome";
Configuration.browserSize ="300x200"; //1920x1080
You can also set your browser maximized with next command:
Configuration.startMaximized = true;
Configuration command has very good functions in it like browser "headless" running, "holdBrowserOpen" and "fastSetValue"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.