VBA code for running selenium webdriver through Javascript,

Viewed 30

i'm trying to pass a variable into VBA code/Javascript for running selenium webdriver, however it throws an error. if i type the string instead the code is picking it up

with string (this is working):

d.ExecuteScript "tinyMCE.activeEditor.setContent('" & "VG Hurrah It worked!" & "');", "javaScript"

However if I try to pass a variable

My_txt = ActiveDocument.Tables(1).Cell(3, 1).Range.Text

d.ExecuteScript "tinyMCE.activeEditor.setContent(' " & My_txt & " ')", "javaScript"

it throws

Runtime error 17, Javascript error "invalid or unexpected token

0 Answers
Related