mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-06 00:09:37 +08:00
fix: 优化获取控件信息为空
This commit is contained in:
@@ -3,6 +3,7 @@ package server_ext
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/rs/zerolog/log"
|
||||
"time"
|
||||
|
||||
"github.com/httprunner/httprunner/v5/pkg/uixt/driver_ext"
|
||||
"github.com/httprunner/httprunner/v5/server"
|
||||
@@ -58,5 +59,9 @@ func (r *RouterExt) sourceHandler(c *gin.Context) {
|
||||
if err != nil {
|
||||
log.Warn().Err(err).Msg("get source failed")
|
||||
}
|
||||
if source == "{}" || source == "" {
|
||||
time.Sleep(1 * time.Second)
|
||||
source, err = driver.Source()
|
||||
}
|
||||
server.RenderSuccess(c, source)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user