java - generating javascript alert in selenium using JavascriptExecutor -


things tried

string selectbook="abc";  string script="alert('"+selectbook+"' book not exist');";  javascriptexecutor js=(javascriptexecutor)driver; js.executescript(script);     

i want alert value of variable select book in alert along message.

the single quotes closed incorrectly

string script="alert('"+selectbook+" book not exist');";  

hope helps you...


Comments