Einstellen von Browser -spezifischen Funktionen mithilfe von BrowsStack SDK

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Einstellen von Browser -spezifischen Funktionen mithilfe von BrowsStack SDK

by Guest » 05 Feb 2025, 04:10

Verwenden des BrowsStack SDK Ich möchte Java Selenium -Tests auf Browsern durchführen: Chrome, Edge und Safari in BrowsStack Cloud; Ich muss jedoch Browser-spezifische Funktionen festlegen:
Zum Beispiel
ChromeOptions Args:-
-Aktivitäts-Aktivitäts-Testing
-Enable-unsafe-Extension-Debugging
-vertrauenswürdige Download-Sources
-Startmaximized
-Ignorieren Sie Zertifikat-Errors
-Deaktiviert-Popup-Blocking < /p>
-Incognito < /p>
-Enable-Download-Warn-Improvements < / p>
-Fenstergröße = 1920.900 < /p>
Kantenoptionen Argumente:-< /strong> < /p>
-Start-maximisiert < /p>
-Headless = new < /p>
Dies ist der BrowsStack SDK YAML-Konfiguration verfügbar Funktionen und Konfiguration YAML GIST:
https://gist.github.com/preekeksabs/053 ... 320880d911
https://wwww. /docs/automatieren/selenium/sdk-faqs/generic/capability-priority
" falls sowohl die BrowsStack.yml-Datei als auch das Testskript die Funktionen definieren, die priorisiert werden. ? Wenn Sie jedoch ähnliche Funktionen haben, die an beiden Standorten erwähnt werden, haben die Funktionen in der Datei browsStack.yml Vorrang . " SDK-Beispielprojekt:
https://www.browserstack.com/docs/autom ... a/selenide

Code: Select all

    @BeforeMethod(alwaysRun = true)
public void setUp() throws Exception {
MutableCapabilities capabilities = new MutableCapabilities();
HashMap bstackOptions = new HashMap();
bstackOptions.put("source", "selenide:sample-master:v1.2");
capabilities.setCapability("bstack:options", bstackOptions);
driver = new RemoteWebDriver(new URL(String.format("https://%s:%s@hub-
cloud.browserstack.com/wd/hub", userName, accessKey)), capabilities);
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
WebDriverRunner.setWebDriver(driver);
}
Dies ist das BrowsStack -Beispielprojekt YAML -Datei:
https://gist.github.com/preseksabs/0532 ... 320880d911< /> Ich verstehe

Code: Select all

    @BeforeMethod(alwaysRun = true)
public void setUp() throws Exception {
MutableCapabilities capabilities = new MutableCapabilities();
HashMap bstackOptions = new HashMap();
bstackOptions.put("source", "selenide:sample-master:v1.2");
capabilities.setCapability("bstack:options", bstackOptions);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless=new");
options.addArguments("window-size=1400,800");
options.addArguments("disable-gpu");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
driver = new RemoteWebDriver(new
URL(String.format("https://%s:%s@hub-
cloud.browserstack.com/wd/hub", userName, accessKey)),
capabilities);
}
(a) [/b], aber würden die Funktionen mit den in der SDK YAML -Datei vorhandenen Chromfunktionen zusammengeführt (und es hat nicht funktioniert)
(b) < /strong> Würde diese Änderung den anderen Brows -Stack -Rand und die Safari -Sitzungen brechen, die mit dem Remotewebdriver gebunden sind. Zu dieser Frage, die die Frage nicht zu beantworten schien:
Sprache für RemotewebDriver - BrowsStack Endpoint < /p>

Top