cost 246 ms
如何在 Python 中的本地和遠程 selenium webdriver 之間切換

[英]How to switch between local and remote selenium webdriver in Python

如何在本地和遠程 selenium webdrivers 之間創建切換器? 也許我們可以在 yml 文件中選擇? 我現在面臨一個問題:如果我在本地運行測試 - gitlab 上的管道失敗,如果在 gitlab 上正常 - 無法在本地運行測試。 對於本地測試,我每次都安裝它: (executable_ ...

無法在 Selenium 遠程 WebDriver 中啟動 Chrome 瀏覽器

[英]Unable to launch Chrome Browser in Selenium Remote WebDriver

我是 Selenium 的新手。 我正在嘗試使用遠程 web 驅動程序啟動 Chrome。 下面是我使用的環境。 在我的本地機器上啟動集線器和節點服務器,如下所示 - 在一台 CMD session 上 - 在另一個 CMD session 我有如下 - 我有如下 Chrome 的代碼 - 我收到以 ...

Selenium Android web 測試“存卡?” 彈窗攔截測試點擊

[英]Selenium Android web test 'Save Card?' pop-up blocking test clicks

嘿,我在通過 Browserstack 在 Android 設備上運行的 Chrome 移動瀏覽器進行 Selenium web 測試時遇到問題。 當我輸入卡詳細信息時,“保存卡?” 出現彈出窗口並阻止對其涵蓋的 web 元素進行測試點擊: 我已經嘗試了一些解決方案,例如將 chrome argu ...

Selenium 頁面加載等待方法

[英]Selenium page loading wait methods

我一直在運行在本地環境中執行速度相對較快但在 Sauce Labs 中執行速度極慢的自動化測試。 現有的 Java 代碼似乎有兩種類型的冗余頁面加載等待時間 pageLoadTimeout 是否是一種可能導致與第二個“document.readyState”顯式等待發生沖突的隱式等待? 這是否完全 ...

C# - Google chrome 在 docker Z0F4137ED1502B5045D2BAA8CZ 上運行 selenium 測試時崩潰

[英]C# - Google chrome is getting crashed when running selenium tests on docker windows

在 docker Z0F4137ED1502B5055D6083AA258 上運行 selenium c# 測試時出現以下錯誤。 誰能幫我解決這個問題。 我真的很難解決它。 我得到的錯誤如下所示: 初始化 chrome 的代碼如下所示: 我正在使用的 docker 信息: 客戶: 上下文:默認調試模 ...

SeleniumGrid:org.openqa.selenium.WebDriverException:無法解析遠程響應:<title> </div></title><div id="text_translate"><p> 我正在嘗試使用 selenium 編寫測試用例。我編寫了這段代碼。 我得到了這個錯誤</p><blockquote><p> org.openqa.selenium.WebDriverException:無法解析遠程響應:</p></blockquote><p> 但我不明白哪里出了問題</p><p></p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"><div class="snippet-code"><pre class="snippet-code-html lang-html prettyprint-override"> public static WebDriver driver=null; ATUTestRecorder recorder; @Parameters({"browsername"}) @BeforeTest public void setUpBrowser(String browsername) throws ATUTestRecorderException, MalformedURLException { String timeStamp = new SimpleDateFormat("yy-MM-dd_HH-mm-ss").format(new Date()); recorder = new ATUTestRecorder("./ScreenRecorder/","Test_"+timeStamp+".mp4",false); DesiredCapabilities cap =null; if(driver==null) { if(browsername.equalsIgnoreCase("Firefox")) { // Set the path for geckodriver.exe //System.setProperty("webdriver.gecko.driver", "./Drivers/geckodriver.exe"); //WebDriverManager.firefoxdriver().setup(); cap = DesiredCapabilities.firefox(); cap.setBrowserName("firefox"); cap.setPlatform(Platform.ANY); driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),cap); } // If the browser is Chrome else if(browsername.equalsIgnoreCase("Chrome")) { // Set the path for chromedriver.exe System.setProperty("webdriver.chrome.driver", "./Drivers/chromedriver.exe"); //WebDriverManager.chromedriver().setup(); cap = DesiredCapabilities.chrome(); cap.setBrowserName("chrome"); cap.setPlatform(Platform.ANY); System.out.println(driver); driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),cap); } // If the browser is IE else if(browsername.equalsIgnoreCase("IE")) { // Set the path for IEdriver.exe //System.setProperty("webdriver.ie.driver", "./Drivers/IEDriverServer.exe"); //WebDriverManager.iedriver().setup(); cap = DesiredCapabilities.inte.netExplorer(); cap.setBrowserName("inte.netExplorer"); cap.setPlatform(Platform.ANY); driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),cap); } driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS); driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); driver.manage().window().maximize(); driver.get(DataConfig.baseURL); } recorder.start(); }</pre></div></div><p></p><p> 我該如何解決這個問題?</p></div>

[英]SeleniumGrid: org.openqa.selenium.WebDriverException: Unable to parse remote response: <html> <head> <title>

我正在嘗試使用 selenium 編寫測試用例。我編寫了這段代碼。 我得到了這個錯誤 org.openqa.selenium.WebDriverException:無法解析遠程響應: 但我不明白哪里出了問題 public static WebDriver driver=null; ATUTestR ...

無法創建遠程驅動程序... org.openqa.selenium.remote.UnreachableBrowserException:從 Jenkins 運行代碼時無法啟動新的 session

[英]Failed to create remote driver... org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session when running code from Jenkins

我有 2 個我使用的源代碼(兩者完全相同): 本地 JAVA 代碼 Jenkins 工作與相同的 Java 代碼。 從 Jenkins 運行時出現以下錯誤: 但是當從我的本地計算機運行相同的代碼到同一個 selenium 網格時 - 一切正常。 一些事實: 我在http://xxxx:5555/g ...

在 IOS 上,元素是“可見的”並被點擊,即使它沒有顯示

[英]On IOS, element is “visible” and being clicked even though it is not displayed

我在 BrowserStack 上運行 selenium 測試時遇到問題。 這個測試應該會失敗。 它在 Android 上確實失敗了,但在 iOS 上通過了,我只是不明白是怎么回事。 不幸的是,我不允許共享 html 代碼,但我可以共享我的代碼。 我正在調用這個方法: 基本上,我試圖點擊移動設 ...

Chrome/Java/Selenium4:使用 RemoteWebDriver 的身份驗證彈出窗口

[英]Chrome/Java/Selenium4: authentication popup with RemoteWebDriver

我想在測試環境中進行一些 Java/Selenium4 測試自動化,該測試環境受身份驗證彈出窗口的保護。 這不是警報,而是 Chrome 彈出窗口: screenshot 。 在我們的框架中,我們有兩種選擇: 您在本地機器上運行測試。 我們使用 org.openqa.selenium.chrome. ...

無法創建新的遠程 session。 主機名 (IP_ADDRESS) 未驗證

[英]Unable to create a new remote session. Hostname (IP_ADDRESS) not verified

我在遠程服務器上托管了一個 Appium 實例。 它能夠在舊版本的 Appium 上連接和執行測試,即相當舊的 java-client 4.1.2。 我試圖將我的 Appium java-client 版本升級到 7.3.0,但我一直遇到錯誤。 現在我在這里閱讀了一些關於如何解決這個問題的答案 ja ...

更改 RemoteWebDriver 的默認下載目標

[英]Changing Default Download Destination for RemoteWebDriver

我試圖將默認下載目錄設置為: 但我沒有運氣找到任何可以這樣做的東西。 我可以找到ChromeDriver的解決方案(請參閱我注釋掉的行),但沒有任何東西可以與RemoteWebDriver的DesiredCapabilities一起使用。 以下是調用RemoteWebDriver的部分目前的樣子: ...

為什么我們不創建一個 object 的 RemoteWebDriver driver = new ChromeDriver(); ? 為什么我們要為 WebDriver 接口創建它

[英]Why dont we create an object of RemoteWebDriver driver = new ChromeDriver(); ? why do we create it for WebDriver interface

我見過很少有其他人也提出同樣的問題,但所有的答案都是關於在網格設置的情況下使用 remotewebdriver。 我知道我們需要將它用於網格。但是為什么我們不能將它用於正常情況下也可以在單台機器上執行代碼? 有人可以解釋一下原因嗎? 謝謝 ...

無法使用 BrowserStack local、BrowserMobProxy 嵌入模式和 Selenium 3.x 使用 java 捕獲瀏覽器網絡日志

[英]Unable to capture browser network logs with BrowserStack local, BrowserMobProxy embedded mode and Selenium 3.x using java

下面是我的 maven pom.xml 中的依賴項 下面是我用來啟動 BrowserMobProxy 的代碼。 變量 httpProxyHost 和 httpProxyPort 是corporateProxy IP 和端口。 下面是啟動 BrowserStack-local 的代碼 下面是在 Bro ...

減少 selenium 上的屏幕截圖時間

[英]Reducing screenshot taking time on selenium

如果代碼在localhost的服務器上執行,截圖速度非常快,不到一秒(大約 400-500 毫秒): 但是如果將目標服務器更改為安裝了 Selenium 服務器的public ip ,則截屏會更慢(大約 5 秒)。 也許這可能是由於客戶端和服務器之間的距離,所以一定有區別。 是否可以減少截屏時間? ...

如何將代理設置為 selenium 遠程 Web 驅動程序?

[英]How can I set proxy to selenium remote web driver?

我正在嘗試在公司代理后面執行 aws 設備場示例。 起初我在連接 aws 時遇到了代理問題。 我設法通過設置 aws 代理配置來解決這個問題。 我關於這個問題的另一個問題 現在我面臨另一個代理問題。 創建 remotewebdriver 時發生未知主機名錯誤。 這是我的源代碼。 這是錯誤日志。 ...

從 Selenium 客戶端獲取剪貼板中的數據

[英]Get to Data in Clipboard from Selenium Client

我想訪問一些在您單擊按鈕 (Jscript) 時復制到網站剪貼板的數據 我使用 Remotewebdriver (ChromeDriver) 來控制測試用例,但無法找到如何訪問此信息。 有人知道怎么做嗎? 如果可能,使用 c# 但 java 解決方案也可以工作。 謝謝 ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM