Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Match   #131

Closed
AngangGuo opened this issue May 26, 2021 · 1 comment
Closed

Can't Match   #131

AngangGuo opened this issue May 26, 2021 · 1 comment

Comments

@AngangGuo
Copy link

I'm using the latest version github.com/mxschmitt/playwright-go v0.1100.0 // indirect

HTML code: For options with space:

<select name="cars" id="test1">
  <option value="t1">t1</option>
  <option value="t2">t 2</option>
  <option value="t3">t&nbsp;3</option>
  <option value="t4">t4</option>
</select>

Playwrite-go code:

// success
v,err:=page.SelectOption("#test1",playwright.SelectOptionValues{Labels: playwright.StringSlice("t 2")})
fmt.Println(v,err)

// failed
v,err=page.SelectOption("#test1",playwright.SelectOptionValues{Labels: playwright.StringSlice("t 3")})
fmt.Println(v,err)

Result:

C:\Andrew\prj\learn>go run select.go
2021/05/26 11:50:59 Downloading browsers...
2021/05/26 11:50:59 Downloaded browsers successfully
  pw:api navigating to "http://localhost:8888/", waiting until "load" +0ms
  pw:api   navigated to "http://localhost:8888/" +799ms
  pw:api   "load" event fired +28ms
  pw:api   "domcontentloaded" event fired +4ms
  pw:api waiting for selector "#test1" +12ms
  pw:api   selector resolved to visible <select id="test1" name="cars">…</select> +23ms
  pw:api   selecting specified option(s) +5ms
  pw:api     selected specified option(s) +11ms
[t2] <nil>
  pw:api waiting for selector "#test1" +37ms
  pw:api   selector resolved to visible <select id="test1" name="cars">…</select> +4ms
  pw:api   selecting specified option(s) +3ms
  pw:api     did not find some options - waiting...  +3ms
  pw:api   "networkidle" event fired +398ms
[] could not send message to server: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for selector "#test1"
  selector resolved to visible <select id="test1" name="cars">…</select>
  selecting specified option(s)
    did not find some options - waiting...
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.

It similar to this issue: microsoft/playwright#3830

@mxschmitt
Copy link
Collaborator

This looks like an upstream bug / or expected behaviour. Please open an issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants