parameters - Entering text into tinymce using webdriver, ruby and variables -


I am using WebDrive and Ruby ...

So I was able to write in text Was using the script below to tinyes the field. However, on the last line, driver.execute ... I would like to replace the fixed value 'bob' which is going to pass the variable, parValue I have tried some modifications to the driver. Execute_script line, but I continue the errors. In other words, I do not know javascript and I am not able to find a way to do this.

I tried to change the code and send it, but it does not print anything in my tinxbox box. Is the value used to be passed from parValue and 'Bob' can be changed?

  def enterValues ​​(driver, parField, parValue) tinymce_frame = driver.find_element (: id = & gt; parField) driver.switch_to.default_content driver.switch_to.frame (tinymce_frame) editor_body = Driver.find_element (: TAG_NAME = & gt; body ') driver.execute_script ("arguments [0] .innerHTML =' bob '", editor_body) end    

< Div class = "post-text" itemprop = "text">

It's very easy, so I'm worried that I have a misunderstanding, but you can use it to bob to String interpolation of ruby ​​to replace parvalue :

  def enterValues ​​(driver, parField, parValue) tinymce_frame = driver.find_element (: id = & Gt; parField) driver.switch_to.default_content driver.switch_to.frame (tinymce_frame) editor_body = driver.find_element (: TAG_NAME = & gt; body ') driver.execute_script ("arguments [0] .innerHTML =' # {} ParValue '', edit_obes) and    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -