HTML Document
name=""
id=""
src=javascript:void(function(){document.open()
%3Bparent.CKEDITOR.tools.callFunction(72%2Cdocument)%3Bdocument.close()
%3B}())
and I need to put some text on that element.
Manually, this field is required.
I tried using innertext and do not work correctly
@browser.frame(:id, "frame1").document.parent.innertext =
"HelloWorld"
but the component disapear from the screen, and i see the tag
Can you help me with a clue?
*********** on the <html dir="ltr"> code it is in this way:
html dir="ltr">
<head>
<body class="cke_show_borders" spellcheck="false">
<p>
<br type="_moz">
</p>
</body>
</html>
*******
Manually, the text is save in the paragraph
<p>
<br type="_moz">
</p>
Thank you!!!
On 5 dic, 06:08, Željko Filipin <zeljko.fili...@wa-research.ch> wrote:
If so you may need to deal with it by mostly using sendkeys to send
keystrokes to a given instance of H1 or P tag inside the main body..
Since this is a third party tool, you may also ask yourself how much
value you provide to your employer by testing code supplied by a third
party instead of focusing on other areas of the application
If your editor control has the 'source' button enabled that might make
it easier to deal with by clicking the span that contains that text
(it's not a button element, it just looks like one due to (I think) a
background image defined for the span) on the demo page, switching
to 'source' mode replaces the wysiwyg editor with a text area control
that shows the actual HTML that was in the editor, which might be a
lot easier to set the contents of, then switch back. (a valid way to
skin this cat since we presume the purpose here is to use the editor
to inject some known content into your system, not test the actual
editor )
Thank you so much for your time..... i'll keep in touch... :D
> > > watir.com/book - author- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -
I found some interesting post in the WEB and i got into this:
@browser.execute_script("CKeditor1.instances.'CKeditor1'.setData('hello
world');")
@browser.frame(:title, "Rich text editor, CKeditor1, press ALT 0 for
help.").send_keys "hello world again"
Taken of a post about autamating CKEditor demo page, i can automate
the page with no problem, so, when i try to implement something
similar into my page is kind of complicated, in chrome i get this
error:
Timeout::Error (Timeout::Error)
C:/Ruby/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill'
C:/Ruby/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
C:/Ruby/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
C:/Ruby/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
C:/Ruby/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
C:/Ruby/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
C:/Ruby/lib/ruby/1.9.1/net/http.rb:1319:in `block in
transport_request'
C:/Ruby/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
C:/Ruby/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
C:/Ruby/lib/ruby/1.9.1/net/http.rb:1293:in `request'
C:/Ruby/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
C:/Ruby/lib/ruby/1.9.1/net/http.rb:745:in `start'
C:/Ruby/lib/ruby/1.9.1/net/http.rb:1284:in `request'
************ in FF and IExplore i get this error:
unknown error (Selenium::WebDriver::Error::UnexpectedJavascriptError)
so i do not know much about java script, so, can you help me to see if
i am implementing this right?
this is my code:
<body onpageshow="null;event.persisted &&
CKEDITOR.tools.callFunction(0)">
<textarea id="CKEditor1" name="CKEditor1" style="visibility:
hidden; display: none;"></textarea>
<span id="cke_CKEditor1" class="cke_skin_kama cke_editor_CKEditor1"
lang="en" aria-labelledby="cke_CKEditor1_arialbl" role="application"
title=" " dir="ltr" onmousedown="return false;">
<script type="text/javascript">
</body>
if you nedd a little more information let me know.
Thank you for your attention and your time :D
There's a lot of potential problems that could cause this, including
different javascript or method names depending on what version your
devs are using vs what you were able to automate against on a sample
site, and the various options that may be enabled for your editor
(those things are highly configurable)
If sendkeys works you may have to see if there is some way (either via
a button, or keystrokes) to do a select all followed by delete
(presuming there is content in the window to start with) and use
sendkeys to send the content you need to the window. a bit brute
force but could potentially work.
When i comment the line with the script, then send_keys is the
problem, the thing is i am setting the same to test the CKEditor page,
and it works ok.
I think the problem is the way i am assigning the frame,
code:
@browser.frame(:title => 'Rich text editor, ckeditor1, press ALT 0
for help.').send_keys("hello world again")
error:
unable to locate frame/iframe using {:title=>"Rich text editor,
ckeditor1, press ALT 0 for help."}
(Watir::Exception::UnknownFrameException)
What I can tell you is that my Frames are inside a Form, and in every
frame i have my CKEditor (one in each frame).
Thank you, if you need some aditional information just let me know.
> > > > - Mostrar texto de la cita -- Ocultar texto de la cita -
In yoursecond posting with the larger code sample it looked like there
are at least two levels of frame nesting.. possibly you need to be
working with the inner one (not being able to see the actual site, and
view the HTML in a proper editor makes it hard to know for sure
exactly which element in the code you gave is the actual editor
window.
You might need to be doing something along the lines of
browser.frame(:id => 'englishDescEditor').tframe.etc
The exact code you say you are trying would only work if the frame in
your app had the title you are specifying, In your code sample I
don't find that anywhere other than in a span, so the not able to
locate error makes complete sense. you'd need to adapt the code that
works on the sample site to fit your site which has different
identifiers, titles, id's etc. .