簡體   English   中英

Jenkins 設置運行 selenium ide 腳本使用 selenium

[英]Jenkins setup to run selenium ide script using selenium rc

我無法通過 jenkins 運行 selenium ide 腳本。 它在檢查資源別名時掛起並且不打開任何瀏覽器。

我嘗試了以下設置:

我已經配置了 selenium 服務器如下:

Jenkins Dashboard -> configure -> Selenium Remote Control -> htmlSuite Runner -> C:\Selenium\selenium-server-standalone-2.37.0.jar

我已將作業配置如下:

Job -> Job Name -> Configure -> Build -> SeleniumHQ htmlSuite Run-> browser: *firefox startURL: https://google.com/ suiteFile: C:\Scripts\Suite.html resultFile: C:\Scripts\results .html`

誰能告訴我我做錯了什么?

按照@glomad的指導,我需要做類似的事情,我解決了如下,我希望它可以幫助其他人:

  1. 根據文檔,我在遠程服務器上創建了 selenium 網格

下載docker 組合文件並運行:

https://github.com/SeleniumHQ/docker-selenium/blob/trunk/docker-compose-v3.yml

docker compose up -d

在此處輸入圖像描述

  1. 就在我在 chrome 中安裝selenium ide並收集測試之后。

https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd

  1. 創建測試並將其導出到 jUnit。 導入時通知遠程URL selenium Grid

在此處輸入圖像描述

在此處輸入圖像描述

  1. 我創建了一個新項目(spring boot)並導入了selenium ide中生成的class。

在您的 pom.xml 中添加了依賴項

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.4.0</version>
</dependency>
  1. 我在導入中做了一些更正

  2. 在 jenkins 中,我配置了管道以下載項目並執行配置的測試。

...
stage('Run Tests') {
     steps {
        sh 'mvn test'
     }
 }
  1. 一切都按預期進行。

![在此處輸入圖像描述

在此處輸入圖像描述

在此處輸入圖像描述

希望這可以幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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