0

Here is html code. I used iFrame class to identify and but unable to locate

<textarea class="form-control qlib-ck-editor" cols="20" id="QuestionText" name="QuestionText" onload="initializeCkInstance('QuestionText');" rows="7" style="visibility: hidden; display: none;"></textarea>

<div id="cke_QuestionText" class="cke_1 cke cke_reset cke_chrome cke_editor_QuestionText cke_ltr cke_browser_webkit" dir="ltr" lang="en" role="application" aria-labelledby="cke_QuestionText_arialbl"><span id="cke_QuestionText_arialbl" class="cke_voice_label">Rich Text Editor, QuestionText</span>
<div class="cke_inner cke_reset" role="presentation"><span id="cke_1_top" class="cke_top cke_reset_all" role="presentation" style="height: auto; user-select: none;">
  <span id="cke_14" class="cke_voice_label">Editor toolbars</span>
    <span id="cke_1_toolbox" class="cke_toolbox" role="group" aria-labelledby="cke_14" onmousedown="return false;">
    <span id="cke_15" class="cke_toolbar cke_toolbar_last" aria-labelledby="cke_15_label" role="toolbar">
      <span id="cke_15_label" class="cke_voice_label">Basic Styles</span>
    <span class="cke_toolbar_start"></span><span class="cke_toolgroup" role="presentation">
      <a id="cke_16" class="cke_button cke_button__bold cke_button_off" href="javascript:void('Bold')" title="Bold (Ctrl+B)" tabindex="-1" hidefocus="true" role="button" aria-labelledby="cke_16_label" aria-describedby="cke_16_description" aria-haspopup="false" onkeydown="return CKEDITOR.tools.callFunction(1,event);" onfocus="return CKEDITOR.tools.callFunction(2,event);" onclick="CKEDITOR.tools.callFunction(3,this);return false;">
        <span class="cke_button_icon cke_button__bold_icon" style="background-image:url('https://qlib-qa.azurewebsites.net/Scripts/ckeditor/plugins/icons.png?t=I3I8');background-position:0 0px;background-size:auto;">&nbsp;</span>
    <span id="cke_16_label" class="cke_button_label cke_button__bold_label" aria-hidden="false">Bold</span>
    <span id="cke_16_description" class="cke_button_label" aria-hidden="false">Keyboard shortcut Ctrl+B</span>
    </a>
    <a id="cke_17" class="cke_button cke_button__italic cke_button_off" href="javascript:void('Italic')" title="Italic (Ctrl+I)" tabindex="-1" hidefocus="true" role="button" aria-labelledby="cke_17_label" aria-describedby="cke_17_description" aria-haspopup="false" onkeydown="return CKEDITOR.tools.callFunction(4,event);" onfocus="return CKEDITOR.tools.callFunction(5,event);" onclick="CKEDITOR.tools.callFunction(6,this);return false;">
        <span class="cke_button_icon cke_button__italic_icon" style="background-image:url('https://qlib-qa.azurewebsites.net/Scripts/ckeditor/plugins/icons.png?t=I3I8');background-position:0 -24px;background-size:auto;">&nbsp;</span>
        <span id="cke_17_label" class="cke_button_label cke_button__italic_label" aria-hidden="false">Italic</span><span id="cke_17_description" class="cke_button_label" aria-hidden="false">Keyboard shortcut Ctrl+I</span>
    </a>
    <a id="cke_18" class="cke_button cke_button__underline cke_button_off" href="javascript:void('Underline')" title="Underline (Ctrl+U)" tabindex="-1" hidefocus="true" role="button" aria-labelledby="cke_18_label" aria-describedby="cke_18_description" aria-haspopup="false" onkeydown="return CKEDITOR.tools.callFunction(7,event);" onfocus="return CKEDITOR.tools.callFunction(8,event);" onclick="CKEDITOR.tools.callFunction(9,this);return false;">
        <span class="cke_button_icon cke_button__underline_icon" style="background-image:url('https://qlib-qa.azurewebsites.net/Scripts/ckeditor/plugins/icons.png?t=I3I8');background-position:0 -120px;background-size:auto;">&nbsp;</span>
        <span id="cke_18_label" class="cke_button_label cke_button__underline_label" aria-hidden="false">Underline</span>
        <span id="cke_18_description" class="cke_button_label" aria-hidden="false">Keyboard shortcut Ctrl+U</span></a>
    </span><span class="cke_toolbar_end"></span></span>
    </span>
    </span>
    <div id="cke_1_contents" class="cke_contents cke_reset" role="presentation" style="height: 200px;">
        <span id="cke_22" class="cke_voice_label">Press ALT 0 for help</span>
        <iframe src="" frameborder="0" class="cke_wysiwyg_frame cke_reset" style="width: 100%; height: 100%;" title="Rich Text Editor, QuestionText" aria-describedby="cke_22" tabindex="0" allowtransparency="true"></iframe>
    </div>
    <span id="cke_1_bottom" class="cke_bottom cke_reset_all" role="presentation" style="user-select: none;">
    <span id="cke_1_resizer" class="cke_resizer cke_resizer_vertical cke_resizer_ltr" title="Resize" onmousedown="CKEDITOR.tools.callFunction(0, event)">◢</span>
    <div class="cke_wordcount" style="" title="Statistics">
        <span id="cke_wordcount_QuestionText" class="cke_path_item">Characters: 0</span>
    </div>
    </span>
</div>
</div>
Murthi
  • 5,299
  • 1
  • 10
  • 15
Manoj
  • 11
  • 5
  • Please take out some time to format the HTML for a well researched answer. Publish your code trials as well. – undetected Selenium Jul 12 '18 at 04:18
  • Can you show your code? – Buaban Jul 12 '18 at 04:44
  • Which language are you using? – Andrei Suvorkov Jul 12 '18 at 04:57
  • I am using C# with Selenium. I do not think language matters in element identification. – Manoj Jul 12 '18 at 05:57
  • @DebanjanB Will take care going forward. Thank you – Manoj Jul 12 '18 at 06:00
  • Tool.SelectPageElement("//iframe[@class='cke_wysiwyg_frame']", "Iframe"); if (WebDriverExtensions.FindElement(_iwdBrowser, By.XPath(sPageElement), 20) != null) { _iweControl = _iwdBrowser.FindElements(By.XPath(sPageElement))[iElementNumber]; _iwdBrowser.SwitchTo().Frame(_iweControl); result = true; } – Manoj Jul 12 '18 at 06:04
  • Below link would help you to get the answer: https://stackoverflow.com/questions/51175323/switching-back-to-parent-frame-after-its-no-longer-in-dom-in-selenium/51189624#51189624][1] – Ankit Gupta Jul 12 '18 at 11:22
  • I was able to identify iFrame using Title and it is working fine :) – Manoj Jul 12 '18 at 17:16

0 Answers0