sammy1983 Posted March 19, 2014 Share Posted March 19, 2014 Hi, Please take a look at the screenshot. This is a iFrame and got the iFrame info using the below code: Local $oFrames = _IEFrameGetCollection($oIE) Local $iNumFrames = @extended Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF Local $oFrame = 0 For $i = 0 To ($iNumFrames - 1) $oFrame = _IEFrameGetCollection($oIE, $i) $sTxt &= _IEPropertyGet($oFrame, "innertext") & @CRLF Next MsgBox($MB_SYSTEMMODAL, "Frames Info", $sTxt) There is only 1 iFrame named "0". Here is my code: $oFrame = _IEFrameGetCollection($oIE, 0) $oInput = _IEGetObjById($oFrame, "tinymce") _IEFormElementSetValue($oInput, "Test") and the output is: --> IE.au3 T3.0-1 Error from function _IEFormElementSetValue, $_IEStatus_InvalidObjectType Can someone help me with this? Thanks. Link to comment Share on other sites More sharing options...
JohnOne Posted March 19, 2014 Share Posted March 19, 2014 what is stopping you from providing the url? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sammy1983 Posted March 19, 2014 Author Share Posted March 19, 2014 (edited) It's an Internal URL. You will not be able to access that, however, I can provide any additional information. Thanks. Providing the URL will be breach of company's security policy. Hope you understand. Also, just trying to understand that how this could be related to URL. The script is able to recognize the iFrame as well, it's just not setting the text. Edited March 19, 2014 by sammy1983 Link to comment Share on other sites More sharing options...
JohnOne Posted March 19, 2014 Share Posted March 19, 2014 I understand, I had same issue one time. I just asked the web guys at the office to give me info, saved me so much time. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Danp2 Posted March 19, 2014 Share Posted March 19, 2014 (edited) There is only 1 iFrame named "0". The frame is named "0" or there is only one frame? Or there is only one frame *and* it's name is "0"? ;-) FWIW, the code you posted retrieves the first frame, not a frame named "0". Edited March 19, 2014 by Danp2 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
sammy1983 Posted March 19, 2014 Author Share Posted March 19, 2014 (edited) Below code is used to get Frame info: Local $oFrames = _IEFrameGetCollection($oIE) Local $iNumFrames = @extended Local $oFrame = 0 For $i = 0 To ($iNumFrames - 1) $oFrame = _IEFrameGetCollection($oIE, $i) $oInput = _IEGetObjById($oFrame, "tinymce") If @error Then ConsoleWrite("Frame number " & $i & ": Object not found! " & @CRLF) Else ConsoleWrite("Frame number " & $i & ": Object found! " & @CRLF) EndIf Next The output is: --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop Frame number 0: Object found! --> IE.au3 T3.0-1 Error from function _IEFormElementSetValue, $_IEStatus_InvalidObjectType Edited March 19, 2014 by sammy1983 Link to comment Share on other sites More sharing options...
sammy1983 Posted March 19, 2014 Author Share Posted March 19, 2014 The frame is named "0" or there is only one frame? Or there is only one frame *and* it's name is "0"? ;-) FWIW, the code you posted retrieves the first frame, not a frame named "0". there is only one frame *and* it's name is "0" Link to comment Share on other sites More sharing options...
sammy1983 Posted March 19, 2014 Author Share Posted March 19, 2014 <body id="tinymce" class="mceContentBody " onload="window.parent.tinyMCE.get('richContent').onLoad.dispatch();" contenteditable="true" dir="ltr"><br data-mce-bogus="1"></body> Link to comment Share on other sites More sharing options...
Danp2 Posted March 19, 2014 Share Posted March 19, 2014 Have you reviewed >this post? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
sammy1983 Posted March 19, 2014 Author Share Posted March 19, 2014 (edited) Have you reviewed >this post? Ok.. so I reviewed the post and below code did Magic. $oFrame = _IEFrameGetCollection($oIE, 0) _IEBodyWriteHTML($oFrame, $text) However, now another problem is this. Local $hEdit ; Create GUI GUICreate("Details", 900, 500) $hEdit = GUICtrlCreateEdit("", 2, 2, 895, 495) GUICtrlSetFont(-1, 9, 700) GUICtrlSetColor(-1, $COLOR_BLACK) ;GUISetState(@SW_SHOW) ; Set Text _GUICtrlEdit_SetText($hEdit, "What is the changes?" & @CRLF & @CRLF & _ "Who will make the change?") $text = _GUICtrlEdit_GetText($hEdit) Though I have given @CRLF & @CRLF, the output is shown in the screenshot. Can this also be recitified? I assume this is because it's writing in HTML format and not in regular Text format. Any ideas? Edited March 19, 2014 by sammy1983 Link to comment Share on other sites More sharing options...
Danp2 Posted March 20, 2014 Share Posted March 20, 2014 I'm confused. Are you still trying to update the tinymce control? If so, I would try <BR> or <P> instead of @CRLF since as you indicated you are writing in HTML format. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Solution sammy1983 Posted March 20, 2014 Author Solution Share Posted March 20, 2014 I'm confused. Are you still trying to update the tinymce control? If so, I would try <BR> or <P> instead of @CRLF since as you indicated you are writing in HTML format. Yes. That made it. I replaced @CRLF with <br> and now I am able to publish text in "tinymce" element using below code. Thanks Danp2 for all your efforts. $oFrame = _IEFrameGetCollection($oIE, 0) _IEBodyWriteHTML($oFrame, $text) where $text = _GUICtrlEdit_GetText($hEdit) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now