if err == nil 后的逻辑不会执行
BeyondIM opened this issue · comments
Rod Version: v0.114.8
func TestRod(t *testing.T) {
_, err := page.Element("[id^='postmessage_'] .locked")
if err == nil {
page.MustElement("[id^='postmessage_'] .locked a").MustClick()
postCommentBtn := page.MustElement("#fwin_reply button[type='submit']")
postCommentBtn.MustWaitStable()
page.MustElement("#fwin_reply #postmessage").MustInput("感谢分享")
postCommentBtn.MustClick().MustWaitInvisible()
}
slog.Info("debug", "111", "111")
}
存在的问题是,如果页面存在 [id^='postmessage_'] .locked
,那么代码执行没有问题,如果不存在,则 slog.Info("debug", "111", "111")
不会执行,很奇怪