JavaScript Need help in writing into an iFrame need help writing a paper,need help writing a book,

I am facing issues in writing into iframe, I am able to identify the iframe but I am not able to write anything into the frame. Whenever I try to write into the frame I am getting below error.

org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with
Command duration or timeout: 211 milliseconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'

This is the screenshot of my HTML Code.

HTML Snippet:

<div id="offer_description_field" class="control-group wysihtml5_type description_field ">
    <label class="control-label" for="offer_description">
        Description
    </label>
    <div class="controls well">
        <ul class="wysihtml5-toolbar" style="">
        <textarea id="offer_description" class="bootstrap-wysihtml5ed" rows="3" name="offer[description]" data-richtext="bootstrap-wysihtml5" data-options="{"csspath":"/assets/bootstrap-wysihtml5.css","jspath":"/assets/bootstrap-wysihtml5.js","config_options":"null"}" cols="48" style="display: none;"></textarea>
        <input type="hidden" name="_wysihtml5_mode" value="1">
        <iframe class="wysihtml5-sandbox" width="0" height="0" frameborder="0" security="restricted" allowtransparency="true" marginwidth="0" marginheight="0" style="display: inline-block; background-color: rgb(255, 255, 255); border-collapse: separate; border-color: rgb(204, 204, 204); border-style: solid; border-width: 1px; clear: none; float: none; margin: 0px; outline: 0px none rgb(0, 0, 0); outline-offset: 0px; padding: 4px 6px; position: static; z-index: auto; vertical-align: middle; text-align: start; box-sizing: content-box; box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.075) inset; border-radius: 4px; width: 327.8px; height: 60px; top: auto; left: auto; right: auto; bottom: auto;"></iframe>
        <p class="help-block">Required. Add offer description.</p>
    </div>
</div>

When I create a simple HTML file with above code snippet I am not able to interact with element. Manually I am able to write anything inside this iframe when it is coming with full code base. Looks like it is replacing the textarea with iframe. Not sure how to deal with this type of element.

This is how it appears on the panel.

Can anybody help?

Answer:1

This error doesn't have to do with the IFRAME. In fact, the element you are interacting with isn't inside the IFRAME. The reason you can't interact with it is stated in the error.

org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with

The element is not visible. If you look at the TEXTAREA element, it is marked with style="display: none;" which is why it is not visible. Selenium was designed to interact with the page as a user would and so will not interact with hidden elements. You will need to approach this problem as a user would... how would a user get that text area to appear? I'm assuming click something, etc. You will need your script to execute whatever a user would do, then the TEXTAREA will become visible, and will be able to be interacted with.

Answer:2

you should takecare of following things while working with frames : 1.Select the frame . then enter into the text/textarea. Note: sometimes the elements are not in the visible area in the UI hence we may required to take the element into view port , following below code spinet before entering into the text/textarea : WebElement element = driver.findElement(By.id("id_of_element")); ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element);

2.then deselect the frame .

Hope this would work for you .

Answer:3

I have a computed method: computed: { currentPosition () { if(this.get_local_storage_state()){ return this.lastLocation } if (this.currentRestaurant) { return this....

I have a computed method: computed: { currentPosition () { if(this.get_local_storage_state()){ return this.lastLocation } if (this.currentRestaurant) { return this....

This code form is working, but it doesn't call the ajax form chat_process.php. I need to call the ajax form and alert a message. var html = ""; for(...) { html += '<form class="...

This code form is working, but it doesn't call the ajax form chat_process.php. I need to call the ajax form and alert a message. var html = ""; for(...) { html += '<form class="...

  1. ajax form not working
  2. ajax form not working mvc
  3. ajax form submit not working
  4. ajax form serialize not working
  5. ajax form submit not working mvc
  6. ajax form preventdefault not working
  7. ajax form success not working
  8. ajax form post not working
  9. ajax form validation not working
  10. ajax form plugin not working
  11. ajax beginform not working
  12. ajax acf_form not working
  13. django ajax form not working

I am using the demo code for intlTelInput provided here I am able to get the dial code using following var intlNumber = $("#phone").intlTelInput("getSelectedCountryData"); But i am not ...

I am using the demo code for intlTelInput provided here I am able to get the dial code using following var intlNumber = $("#phone").intlTelInput("getSelectedCountryData"); But i am not ...

Cannot reproduce MDN's example («Using an object in an array-like fashion»). let obj = { length: 0, addEl: function (element) { [].push.call(this, element); }; }; // Node ...

Cannot reproduce MDN's example («Using an object in an array-like fashion»). let obj = { length: 0, addEl: function (element) { [].push.call(this, element); }; }; // Node ...

  1. call using push