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