Skip to content

Releases: zninggo/selenium

v0.12.0

Choose a tag to compare

@zninggo zninggo released this 19 Jul 13:17

v0.12.0 — Shadow DOM

iframe(原本就有)

  • SwitchFrame(frame):按 id / WebElement / nil 切换浏览上下文

Shadow DOM(新增)

host, err := wd.FindElement(selenium.ByID, "host")
root, err := host.GetShadowRoot()
btn, err := root.FindElement(selenium.ByID, "inner-btn")
btn.Click()
  • open shadow root(W3C / ChromeDriver)
  • 端点:GET .../element/{id}/shadow,查找 .../shadow/{id}/element[s]

验证

  • 本地 Chromium + ChromeDriver 150 headless:TestSmokeChrome PASS(含 shadow)
  • 光 DOM 找不到内部节点,经 GetShadowRoot 可找可点
go get github.com/zninggo/selenium@v0.12.0

v0.11.1

Choose a tag to compare

@zninggo zninggo released this 19 Jul 12:58

v0.11.1 — Chinese README

  • New README.zh-CN.md (简体中文)
  • Language switcher on both READMEs:
    • English: Language: English | 简体中文
    • 中文: 语言:English | 简体中文
go get github.com/zninggo/selenium@v0.11.1

v0.11.0

Choose a tag to compare

@zninggo zninggo released this 19 Jul 12:53

v0.11.0 — CDP + optional browser CI

CDP

  • WebDriver.ExecuteCDPCommand(cmd, params) → ChromeDriver POST /session/{id}/goog/cdp/execute
  • No extra dependencies (raw cmd + params)
  • TestSmokeChrome checks Browser.getVersion when Chrome is present
  • Example_cdp in example_test.go
res, err := wd.ExecuteCDPCommand("Browser.getVersion", nil)
// res is map[string]interface{} with product, userAgent, ...

Browser CI

  • New workflow: browser (Actions → browser → Run workflow)
  • Also weekly schedule; downloads Chrome for Testing then runs smoke
  • Default ci workflow unchanged (fast, no forced browser download)
go get github.com/zninggo/selenium@v0.11.0

v0.10.8

Choose a tag to compare

@zninggo zninggo released this 19 Jul 12:50

v0.10.8 — docs and modern examples

  • README: migrate to @v0.10.7+, URL prefix cheat sheet, fork behavior notes
  • ExampleChromeDriver: ChromeDriver 115+ root URL (no /wd/hub)
  • Example_selenium4: NewSeleniumServiceV4 root URL
  • Legacy Selenium 3 Example kept for /wd/hub
go get github.com/zninggo/selenium@v0.10.8

v0.10.7

Choose a tag to compare

@zninggo zninggo released this 19 Jul 12:45

v0.10.7 — smoke test read-back fix

  • TestSmokeChrome verifies typed text via GetProperty("value") (headless Chrome attribute was empty on CI)
  • Includes v0.10.6 smoke coverage: session, W3C find, SendKeys, cookie, CurrentURL, teardown
  • ChromeDriver tests use root URL (not /wd/hub)
go get github.com/zninggo/selenium@v0.10.7
go test -mod=mod -count=1 -timeout=5m -run TestSmokeChrome -v

v0.10.6

Choose a tag to compare

@zninggo zninggo released this 19 Jul 12:42

v0.10.6 — Chrome smoke test

  • TestSmokeChrome: main-path regression against real ChromeDriver when present
    • session (root URL, W3C caps)
    • ByID / ByClassName
    • SendKeys
    • cookie add/get
    • CurrentURL / Title
    • Quit + Service.Stop
  • Skips when chromedriver/Chrome are missing (default CI stays green)
  • Fix ChromeDriver direct integration tests to use root URL, not /wd/hub
go get github.com/zninggo/selenium@v0.10.6
cd vendor && go run init.go --alsologtostderr --download_browsers && cd ..
go test -mod=mod -count=1 -timeout=5m -run TestSmokeChrome -v

v0.10.5

Choose a tag to compare

@zninggo zninggo released this 19 Jul 12:34

v0.10.5 — remaining upstream bugfixes from open issues/PRs

  • Set Content-Type: application/json on requests with a body (PR tebeka#153/tebeka#274; WinAppDriver etc.)
  • W3C SendKeys sends both text and value string list (issue tebeka#199)
  • Cookie Path/Domain/Secure/HTTPOnly omitempty (PR tebeka#283 / tebeka#130 family)
  • Fix internal wire cookie sameSite JSON tag
  • NewSeleniumService only passes -debug when SetDebug(true) (issue tebeka#193)
go get github.com/zninggo/selenium@v0.10.5

v0.10.4

Choose a tag to compare

@zninggo zninggo released this 19 Jul 12:16

v0.10.4 — multi-OS browser downloads

  • vendor/init.go selects assets by GOOS/GOARCH (linux64, mac-x64, mac-arm64, win32, win64)
  • Chrome / ChromeDriver from Chrome for Testing Stable API
  • Firefox / geckodriver / Sauce Connect packages matched per platform
  • Unsupported platforms error clearly instead of downloading Linux-only URLs
  • Dropped cloud.google.com/go usage from the init helper
  • HTMLUnit tests skip when java is not on PATH
go get github.com/zninggo/selenium@v0.10.4
cd vendor && go run init.go --alsologtostderr --download_browsers --download_latest

v0.10.3

Choose a tag to compare

@zninggo zninggo released this 19 Jul 12:07

v0.10.3 — Linux orphan process cleanup

  • Service / Xvfb children: process group + Pdeathsig=SIGKILL on Linux
  • Stop kills the process group; failed start tears down half-started processes
  • Sauce Connect: enable Pdeathsig when QuitProcessUponExit is set (platform-specific)
go get github.com/zninggo/selenium@v0.10.3

v0.10.2

Choose a tag to compare

@zninggo zninggo released this 19 Jul 11:56

v0.10.2 — W3C find mapping + Selenium 4 service

  • W3C mode maps:
    • ByID#id
    • ByName[name="..."] (was only input[name=...])
    • ByClassName[class~="..."]
  • New NewSeleniumServiceV4(jarPath, port, opts...) for Selenium 4+ standalone
    • Listens at http://localhost:<port> (no /wd/hub)
    • Use that URL as NewRemote urlPrefix
go get github.com/zninggo/selenium@v0.10.2

Selenium 4 example

svc, err := selenium.NewSeleniumServiceV4("selenium-server-4.x.jar", 4444)
// ...
wd, err := selenium.NewRemote(caps, "http://localhost:4444")