当前位置:网站首页>executeScript异步执行的时候没有返回值的原因
executeScript异步执行的时候没有返回值的原因
2022-08-02 16:45:00 【安卓世界库】
异步执行,函数执行完看,但是里面的值系统还在没有赋值完毕,所以返回值的时候总是空或者没有内容。此时应该让线程等待一会。
例子:
JavascriptExecutor jsdriver=(JavascriptExecutor)cmdriver;
jsdriver.executeScript(sjs);
String yx = "return ygid(\"sdsd\")";
jsdriver.executeScript(yx);
Thread.sleep(5000);//等待一段时间,然后提取内容
yx = "return ygtn()";
//String s = x.toString();
System.out.println(jsdriver.executeScript(yx));
边栏推荐
猜你喜欢
随机推荐
【无标题】
MYSQL一站式学习,看完即学完
One article to understand DI dependency injection in php
navicat创建连接 2002-can‘t connect to server on localhost(10061)且mysql服务已启动问题
numpy的学习笔记
金仓数据库KingbaseES安全指南--6.13. 关于身份验证的常见问题
Detailed explanation of the principle of JWT_The principle of electromagnetic induction
In the idea to create a web project _idea deployment of the web project
When Oracle analyzes the archive log content, it finds many nulls?
npm install报错Fix the upstream dependency conflict, or retry
julia系列1:介绍与安装
AI智能剪辑,仅需2秒一键提取精彩片段
npm install报gyp info it worked if it ends with ok
小程序实现手写左右翻页和动态修改横向滚动条位置
MySQL常用的日期时间函数
总结嵌入式C语言难点 (1部分) 【结尾有资料】
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(十)
什么是实时流引擎?
Smart Contract Security - delegatecall (1)
特殊变量 (SQL)









