playwright-community/playwright-go

Screenshot crash with locator mask

Lonka opened this issue · 0 comments

Lonka commented

Hello, I attempt to screenshot the page and mask the sensitive information by set the Mask property with locator as below code.

l := page.Locator("//*[@id=\"inputPassword\"]")
po := playwright.PageScreenshotOptions{ 
    Path: playwright.String("test1.png"),
}
po.Mask = append(po.Mask, l)
page.Screenshot(po)

But I receive the panic error as below.

panic: reflect.Value.Interface: cannot return value obtained from unexported field or method

goroutine 1 [running]:
reflect.valueInterface({0x11cf3e0?, 0xc000308300?, 0x1255900?}, 0x1?)
        D:/Program Files/Go/src/reflect/value.go:1491 +0xd8
reflect.Value.Interface(...)
        D:/Program Files/Go/src/reflect/value.go:1480
github.com/playwright-community/playwright-go.transformStructIntoMapIfNeeded({0x11cc5a0, 0xc000308300})
        C:/Users/lonka/go/pkg/mod/github.com/playwright-community/playwright-go@v0.3800.0/helpers.go:73 +0x4cf
github.com/playwright-community/playwright-go.transformStructValues({0x11cc5a0, 0xc000308300?})
        C:/Users/lonka/go/pkg/mod/github.com/playwright-community/playwright-go@v0.3800.0/helpers.go:36 +0x226
github.com/playwright-community/playwright-go.transformStructValues({0x114d3c0, 0xc0001b6170?})
        C:/Users/lonka/go/pkg/mod/github.com/playwright-community/playwright-go@v0.3800.0/helpers.go:42 +0x2ce
github.com/playwright-community/playwright-go.transformStructIntoMapIfNeeded({0x11bb860, 0xc0001b6150})
        C:/Users/lonka/go/pkg/mod/github.com/playwright-community/playwright-go@v0.3800.0/helpers.go:73 +0x4d4
github.com/playwright-community/playwright-go.transformOptions({0xc00011dcb8, 0xc0001ac410?, 0xd0?})
        C:/Users/lonka/go/pkg/mod/github.com/playwright-community/playwright-go@v0.3800.0/helpers.go:123 +0x1fc
github.com/playwright-community/playwright-go.(*channel).innerSend(0xc0002b06c0, {0x11d3b14, 0xa}, 0x0, {0xc00011dcb8?, 0xc000192940?, 0xc000192960?})
        C:/Users/lonka/go/pkg/mod/github.com/playwright-community/playwright-go@v0.3800.0/channel.go:28 +0x5f
github.com/playwright-community/playwright-go.(*channel).Send.func1()
        C:/Users/lonka/go/pkg/mod/github.com/playwright-community/playwright-go@v0.3800.0/channel.go:17 +0x33
github.com/playwright-community/playwright-go.(*connection).WrapAPICall(0xc0000c0280, 0xc00011dc20, 0x20?)
        C:/Users/lonka/go/pkg/mod/github.com/playwright-community/playwright-go@v0.3800.0/connection.go:139 +0xb1
github.com/playwright-community/playwright-go.(*channel).Send(0xc0001b60e0?, {0x11d3b14?, 0x1?}, {0xc00011dcb8?, 0x1449120?, 0xc0001b60e0?})
        C:/Users/lonka/go/pkg/mod/github.com/playwright-community/playwright-go@v0.3800.0/channel.go:16 +0x70
github.com/playwright-community/playwright-go.(*pageImpl).Screenshot(0xc000100640, {0xc0001b60e0?, 0x5?, 0x0?})
        C:/Users/lonka/go/pkg/mod/github.com/playwright-community/playwright-go@v0.3800.0/page.go:324 +0x85
github.com/Lonka/test/main.(*PopulateTextField).Run(0xc0000be000)
        D:/Projects/test/main.go:107 +0x448
main.main()
        D:/Projects/test/main.go:32 +0x18f

Is there something I haven't set correctly?
thanks