[英]generating javascript alert in selenium using JavascriptExecutor
Things tried 尝试过的事情
String selectBook="abc";
String script="alert('"+selectBook+"' book does not exist');";
JavascriptExecutor js=(JavascriptExecutor)driver;
js.executeScript(script);
I want to alert the value of variable select book in alert along with the message. 我想在警报以及消息中警报变量select book的值。
The single quotes are closed incorrectly 单引号关闭不正确
String script="alert('"+selectBook+" book does not exist');";
Hope this helps you... 希望这对您有帮助...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.