double click visual element not in html to make textarea appear selenium











up vote
1
down vote

favorite
1












I want to enter text into a textarea. The problem is the textarea is only created and shows up in the html after clicking twice on a visual element in the browser.
For this visual element Dubbelklik om je tekst te typen, I cannot find an element in the html that refers to it and perform a double_click(). There are only containers, that either are unclickable elements, or allow clicks, but don't perform an action.



Up until here it works and the visual cue to double click appears slightly below the center:



from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait as wait

driver = webdriver.Chrome()
driver.get("https://www.hallmark.nl/kaarten/verjaardag-man/")
#wait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href*='https://www.hallmark.nl:443/kaarten/verjaardag-man/grappig-m/make-that-the-cat-wise/happy-bursdeej-to-jou-3415094.aspx']"))).click()
wait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href*='https://www.hallmark.nl:443/kaarten/verjaardag-man/grappig-m/hallmark/een-jaguar-voor-je-verjaardag-3346861.aspx']"))).click()
wait(driver, 10).until(EC.element_to_be_clickable((By.ID, "btnShowSizepicker"))).click()
wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//span[text()='Standaard']"))).click()
wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//div[contains(@class, 'showDesktop')]//button[contains(text(),'Binnenkant')]"))).click()


But from then on I can't seem to find anything to make selenium click on the element.
I have tried clicking the things I can locate in the html:



# elem = driver.find_element_by_xpath("//div[contains(@class, 'canvasAnchor')]").click()


This gives an element not interactable error. I have also tried using an offset for a findable element:



elem = driver.find_element_by_class_name("canvas-container")
print(elem.location)
print(elem.size)
action = webdriver.common.action_chains.ActionChains(driver)
action.move_to_element_with_offset(elem, 0.5*elem.location.get('x'), (0.5*elem.location.get('y'))) #should click in the middle of this container
action.double_click()
action.perform()


But for different elements and values of x and y, I can only get it to do either nothing, or click on the contact sidebar (which highlights the word 'Neem').



If I click twice manually, a textarea appears in the html and I can execute send_keys('hello world')










share|improve this question


























    up vote
    1
    down vote

    favorite
    1












    I want to enter text into a textarea. The problem is the textarea is only created and shows up in the html after clicking twice on a visual element in the browser.
    For this visual element Dubbelklik om je tekst te typen, I cannot find an element in the html that refers to it and perform a double_click(). There are only containers, that either are unclickable elements, or allow clicks, but don't perform an action.



    Up until here it works and the visual cue to double click appears slightly below the center:



    from selenium import webdriver
    from selenium.webdriver.common.keys import Keys
    from selenium.webdriver.support import expected_conditions as EC
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait as wait

    driver = webdriver.Chrome()
    driver.get("https://www.hallmark.nl/kaarten/verjaardag-man/")
    #wait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href*='https://www.hallmark.nl:443/kaarten/verjaardag-man/grappig-m/make-that-the-cat-wise/happy-bursdeej-to-jou-3415094.aspx']"))).click()
    wait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href*='https://www.hallmark.nl:443/kaarten/verjaardag-man/grappig-m/hallmark/een-jaguar-voor-je-verjaardag-3346861.aspx']"))).click()
    wait(driver, 10).until(EC.element_to_be_clickable((By.ID, "btnShowSizepicker"))).click()
    wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//span[text()='Standaard']"))).click()
    wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//div[contains(@class, 'showDesktop')]//button[contains(text(),'Binnenkant')]"))).click()


    But from then on I can't seem to find anything to make selenium click on the element.
    I have tried clicking the things I can locate in the html:



    # elem = driver.find_element_by_xpath("//div[contains(@class, 'canvasAnchor')]").click()


    This gives an element not interactable error. I have also tried using an offset for a findable element:



    elem = driver.find_element_by_class_name("canvas-container")
    print(elem.location)
    print(elem.size)
    action = webdriver.common.action_chains.ActionChains(driver)
    action.move_to_element_with_offset(elem, 0.5*elem.location.get('x'), (0.5*elem.location.get('y'))) #should click in the middle of this container
    action.double_click()
    action.perform()


    But for different elements and values of x and y, I can only get it to do either nothing, or click on the contact sidebar (which highlights the word 'Neem').



    If I click twice manually, a textarea appears in the html and I can execute send_keys('hello world')










    share|improve this question
























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I want to enter text into a textarea. The problem is the textarea is only created and shows up in the html after clicking twice on a visual element in the browser.
      For this visual element Dubbelklik om je tekst te typen, I cannot find an element in the html that refers to it and perform a double_click(). There are only containers, that either are unclickable elements, or allow clicks, but don't perform an action.



      Up until here it works and the visual cue to double click appears slightly below the center:



      from selenium import webdriver
      from selenium.webdriver.common.keys import Keys
      from selenium.webdriver.support import expected_conditions as EC
      from selenium.webdriver.common.by import By
      from selenium.webdriver.support.ui import WebDriverWait as wait

      driver = webdriver.Chrome()
      driver.get("https://www.hallmark.nl/kaarten/verjaardag-man/")
      #wait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href*='https://www.hallmark.nl:443/kaarten/verjaardag-man/grappig-m/make-that-the-cat-wise/happy-bursdeej-to-jou-3415094.aspx']"))).click()
      wait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href*='https://www.hallmark.nl:443/kaarten/verjaardag-man/grappig-m/hallmark/een-jaguar-voor-je-verjaardag-3346861.aspx']"))).click()
      wait(driver, 10).until(EC.element_to_be_clickable((By.ID, "btnShowSizepicker"))).click()
      wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//span[text()='Standaard']"))).click()
      wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//div[contains(@class, 'showDesktop')]//button[contains(text(),'Binnenkant')]"))).click()


      But from then on I can't seem to find anything to make selenium click on the element.
      I have tried clicking the things I can locate in the html:



      # elem = driver.find_element_by_xpath("//div[contains(@class, 'canvasAnchor')]").click()


      This gives an element not interactable error. I have also tried using an offset for a findable element:



      elem = driver.find_element_by_class_name("canvas-container")
      print(elem.location)
      print(elem.size)
      action = webdriver.common.action_chains.ActionChains(driver)
      action.move_to_element_with_offset(elem, 0.5*elem.location.get('x'), (0.5*elem.location.get('y'))) #should click in the middle of this container
      action.double_click()
      action.perform()


      But for different elements and values of x and y, I can only get it to do either nothing, or click on the contact sidebar (which highlights the word 'Neem').



      If I click twice manually, a textarea appears in the html and I can execute send_keys('hello world')










      share|improve this question













      I want to enter text into a textarea. The problem is the textarea is only created and shows up in the html after clicking twice on a visual element in the browser.
      For this visual element Dubbelklik om je tekst te typen, I cannot find an element in the html that refers to it and perform a double_click(). There are only containers, that either are unclickable elements, or allow clicks, but don't perform an action.



      Up until here it works and the visual cue to double click appears slightly below the center:



      from selenium import webdriver
      from selenium.webdriver.common.keys import Keys
      from selenium.webdriver.support import expected_conditions as EC
      from selenium.webdriver.common.by import By
      from selenium.webdriver.support.ui import WebDriverWait as wait

      driver = webdriver.Chrome()
      driver.get("https://www.hallmark.nl/kaarten/verjaardag-man/")
      #wait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href*='https://www.hallmark.nl:443/kaarten/verjaardag-man/grappig-m/make-that-the-cat-wise/happy-bursdeej-to-jou-3415094.aspx']"))).click()
      wait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href*='https://www.hallmark.nl:443/kaarten/verjaardag-man/grappig-m/hallmark/een-jaguar-voor-je-verjaardag-3346861.aspx']"))).click()
      wait(driver, 10).until(EC.element_to_be_clickable((By.ID, "btnShowSizepicker"))).click()
      wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//span[text()='Standaard']"))).click()
      wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//div[contains(@class, 'showDesktop')]//button[contains(text(),'Binnenkant')]"))).click()


      But from then on I can't seem to find anything to make selenium click on the element.
      I have tried clicking the things I can locate in the html:



      # elem = driver.find_element_by_xpath("//div[contains(@class, 'canvasAnchor')]").click()


      This gives an element not interactable error. I have also tried using an offset for a findable element:



      elem = driver.find_element_by_class_name("canvas-container")
      print(elem.location)
      print(elem.size)
      action = webdriver.common.action_chains.ActionChains(driver)
      action.move_to_element_with_offset(elem, 0.5*elem.location.get('x'), (0.5*elem.location.get('y'))) #should click in the middle of this container
      action.double_click()
      action.perform()


      But for different elements and values of x and y, I can only get it to do either nothing, or click on the contact sidebar (which highlights the word 'Neem').



      If I click twice manually, a textarea appears in the html and I can execute send_keys('hello world')







      python-3.x selenium selenium-chromedriver






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 18:25









      DaReal

      101215




      101215
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted
          +50










          The element where you have to click is actually canvas, so what you have to do is that move cursor to the position where double click is needed and then click there.



          I tried this over your code and worked for me:



          from selenium.webdriver.common.action_chains import ActionChains

          elem = driver.find_element_by_xpath('//*[@class="canvasWrapper active"]//*[@class="canvas-container"]')
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).double_click().perform()


          Note:You may have to wait for the canvas element to load properly. I just tried from prompt.



          You can read about this mouse action here.



          UPDATE:



          I noticed that somehow the double click was behaving as single click for me, so changed to this.



          from selenium.webdriver.common.action_chains import ActionChains
          import time

          elem = driver.find_element_by_xpath('//*[@class="canvasWrapper active"]//*[@class="canvas-container"]')
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).click().perform()
          time.sleep(1)
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).click().perform()





          share|improve this answer























          • Hi Kamal, 3 questions: 1. how do you know which is the element to click, because there's also an inside canvas, upper canvas, lower canvas, and so on? 2. What did you base the x and y offset on? 3. With the code you provided, the textarea (triggered by clicking twice) does not appear. But it does seem if I click manually to make the textarea appear, I can 'unclick' the element by running your code.
            – DaReal
            Nov 14 at 19:11






          • 1




            1. I was trying to click on the position where canvas has the text and is clickable. I was able to do the same using 'canvas-container' div element(as mentioned in answer), 'inside-canvas' canvas element and 'lower-canvas' canvas element because all of them are in same position.
            – Kamal
            Nov 15 at 5:07






          • 1




            2. move_to_element_with_offset will take the top-left corner of the element as start point and move as per the offset given. I manually checked how much offset I need from top-left corner of canvas to reach the text. I think this could be the reason why it did not work for you. May be the offset will change based on screen size. 3. I think somehow the double click is behaving as single click in my case also, so I clicked once, then clicked again after 1s and it worked. I have updated the answer with that.
            – Kamal
            Nov 15 at 5:07












          • Perfect, it took some tries to get the x and y offset for my screen, but it works! Thank you for the explanation as well. So originally it didn't work for me because I could not find the right element and was clicking on non-clickable areas.
            – DaReal
            Nov 15 at 19:35











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242092%2fdouble-click-visual-element-not-in-html-to-make-textarea-appear-selenium%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote



          accepted
          +50










          The element where you have to click is actually canvas, so what you have to do is that move cursor to the position where double click is needed and then click there.



          I tried this over your code and worked for me:



          from selenium.webdriver.common.action_chains import ActionChains

          elem = driver.find_element_by_xpath('//*[@class="canvasWrapper active"]//*[@class="canvas-container"]')
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).double_click().perform()


          Note:You may have to wait for the canvas element to load properly. I just tried from prompt.



          You can read about this mouse action here.



          UPDATE:



          I noticed that somehow the double click was behaving as single click for me, so changed to this.



          from selenium.webdriver.common.action_chains import ActionChains
          import time

          elem = driver.find_element_by_xpath('//*[@class="canvasWrapper active"]//*[@class="canvas-container"]')
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).click().perform()
          time.sleep(1)
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).click().perform()





          share|improve this answer























          • Hi Kamal, 3 questions: 1. how do you know which is the element to click, because there's also an inside canvas, upper canvas, lower canvas, and so on? 2. What did you base the x and y offset on? 3. With the code you provided, the textarea (triggered by clicking twice) does not appear. But it does seem if I click manually to make the textarea appear, I can 'unclick' the element by running your code.
            – DaReal
            Nov 14 at 19:11






          • 1




            1. I was trying to click on the position where canvas has the text and is clickable. I was able to do the same using 'canvas-container' div element(as mentioned in answer), 'inside-canvas' canvas element and 'lower-canvas' canvas element because all of them are in same position.
            – Kamal
            Nov 15 at 5:07






          • 1




            2. move_to_element_with_offset will take the top-left corner of the element as start point and move as per the offset given. I manually checked how much offset I need from top-left corner of canvas to reach the text. I think this could be the reason why it did not work for you. May be the offset will change based on screen size. 3. I think somehow the double click is behaving as single click in my case also, so I clicked once, then clicked again after 1s and it worked. I have updated the answer with that.
            – Kamal
            Nov 15 at 5:07












          • Perfect, it took some tries to get the x and y offset for my screen, but it works! Thank you for the explanation as well. So originally it didn't work for me because I could not find the right element and was clicking on non-clickable areas.
            – DaReal
            Nov 15 at 19:35















          up vote
          3
          down vote



          accepted
          +50










          The element where you have to click is actually canvas, so what you have to do is that move cursor to the position where double click is needed and then click there.



          I tried this over your code and worked for me:



          from selenium.webdriver.common.action_chains import ActionChains

          elem = driver.find_element_by_xpath('//*[@class="canvasWrapper active"]//*[@class="canvas-container"]')
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).double_click().perform()


          Note:You may have to wait for the canvas element to load properly. I just tried from prompt.



          You can read about this mouse action here.



          UPDATE:



          I noticed that somehow the double click was behaving as single click for me, so changed to this.



          from selenium.webdriver.common.action_chains import ActionChains
          import time

          elem = driver.find_element_by_xpath('//*[@class="canvasWrapper active"]//*[@class="canvas-container"]')
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).click().perform()
          time.sleep(1)
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).click().perform()





          share|improve this answer























          • Hi Kamal, 3 questions: 1. how do you know which is the element to click, because there's also an inside canvas, upper canvas, lower canvas, and so on? 2. What did you base the x and y offset on? 3. With the code you provided, the textarea (triggered by clicking twice) does not appear. But it does seem if I click manually to make the textarea appear, I can 'unclick' the element by running your code.
            – DaReal
            Nov 14 at 19:11






          • 1




            1. I was trying to click on the position where canvas has the text and is clickable. I was able to do the same using 'canvas-container' div element(as mentioned in answer), 'inside-canvas' canvas element and 'lower-canvas' canvas element because all of them are in same position.
            – Kamal
            Nov 15 at 5:07






          • 1




            2. move_to_element_with_offset will take the top-left corner of the element as start point and move as per the offset given. I manually checked how much offset I need from top-left corner of canvas to reach the text. I think this could be the reason why it did not work for you. May be the offset will change based on screen size. 3. I think somehow the double click is behaving as single click in my case also, so I clicked once, then clicked again after 1s and it worked. I have updated the answer with that.
            – Kamal
            Nov 15 at 5:07












          • Perfect, it took some tries to get the x and y offset for my screen, but it works! Thank you for the explanation as well. So originally it didn't work for me because I could not find the right element and was clicking on non-clickable areas.
            – DaReal
            Nov 15 at 19:35













          up vote
          3
          down vote



          accepted
          +50







          up vote
          3
          down vote



          accepted
          +50




          +50




          The element where you have to click is actually canvas, so what you have to do is that move cursor to the position where double click is needed and then click there.



          I tried this over your code and worked for me:



          from selenium.webdriver.common.action_chains import ActionChains

          elem = driver.find_element_by_xpath('//*[@class="canvasWrapper active"]//*[@class="canvas-container"]')
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).double_click().perform()


          Note:You may have to wait for the canvas element to load properly. I just tried from prompt.



          You can read about this mouse action here.



          UPDATE:



          I noticed that somehow the double click was behaving as single click for me, so changed to this.



          from selenium.webdriver.common.action_chains import ActionChains
          import time

          elem = driver.find_element_by_xpath('//*[@class="canvasWrapper active"]//*[@class="canvas-container"]')
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).click().perform()
          time.sleep(1)
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).click().perform()





          share|improve this answer














          The element where you have to click is actually canvas, so what you have to do is that move cursor to the position where double click is needed and then click there.



          I tried this over your code and worked for me:



          from selenium.webdriver.common.action_chains import ActionChains

          elem = driver.find_element_by_xpath('//*[@class="canvasWrapper active"]//*[@class="canvas-container"]')
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).double_click().perform()


          Note:You may have to wait for the canvas element to load properly. I just tried from prompt.



          You can read about this mouse action here.



          UPDATE:



          I noticed that somehow the double click was behaving as single click for me, so changed to this.



          from selenium.webdriver.common.action_chains import ActionChains
          import time

          elem = driver.find_element_by_xpath('//*[@class="canvasWrapper active"]//*[@class="canvas-container"]')
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).click().perform()
          time.sleep(1)
          ActionChains(driver).move_to_element_with_offset(elem, 70, 60).click().perform()






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 15 at 5:10

























          answered Nov 14 at 11:35









          Kamal

          1739




          1739












          • Hi Kamal, 3 questions: 1. how do you know which is the element to click, because there's also an inside canvas, upper canvas, lower canvas, and so on? 2. What did you base the x and y offset on? 3. With the code you provided, the textarea (triggered by clicking twice) does not appear. But it does seem if I click manually to make the textarea appear, I can 'unclick' the element by running your code.
            – DaReal
            Nov 14 at 19:11






          • 1




            1. I was trying to click on the position where canvas has the text and is clickable. I was able to do the same using 'canvas-container' div element(as mentioned in answer), 'inside-canvas' canvas element and 'lower-canvas' canvas element because all of them are in same position.
            – Kamal
            Nov 15 at 5:07






          • 1




            2. move_to_element_with_offset will take the top-left corner of the element as start point and move as per the offset given. I manually checked how much offset I need from top-left corner of canvas to reach the text. I think this could be the reason why it did not work for you. May be the offset will change based on screen size. 3. I think somehow the double click is behaving as single click in my case also, so I clicked once, then clicked again after 1s and it worked. I have updated the answer with that.
            – Kamal
            Nov 15 at 5:07












          • Perfect, it took some tries to get the x and y offset for my screen, but it works! Thank you for the explanation as well. So originally it didn't work for me because I could not find the right element and was clicking on non-clickable areas.
            – DaReal
            Nov 15 at 19:35


















          • Hi Kamal, 3 questions: 1. how do you know which is the element to click, because there's also an inside canvas, upper canvas, lower canvas, and so on? 2. What did you base the x and y offset on? 3. With the code you provided, the textarea (triggered by clicking twice) does not appear. But it does seem if I click manually to make the textarea appear, I can 'unclick' the element by running your code.
            – DaReal
            Nov 14 at 19:11






          • 1




            1. I was trying to click on the position where canvas has the text and is clickable. I was able to do the same using 'canvas-container' div element(as mentioned in answer), 'inside-canvas' canvas element and 'lower-canvas' canvas element because all of them are in same position.
            – Kamal
            Nov 15 at 5:07






          • 1




            2. move_to_element_with_offset will take the top-left corner of the element as start point and move as per the offset given. I manually checked how much offset I need from top-left corner of canvas to reach the text. I think this could be the reason why it did not work for you. May be the offset will change based on screen size. 3. I think somehow the double click is behaving as single click in my case also, so I clicked once, then clicked again after 1s and it worked. I have updated the answer with that.
            – Kamal
            Nov 15 at 5:07












          • Perfect, it took some tries to get the x and y offset for my screen, but it works! Thank you for the explanation as well. So originally it didn't work for me because I could not find the right element and was clicking on non-clickable areas.
            – DaReal
            Nov 15 at 19:35
















          Hi Kamal, 3 questions: 1. how do you know which is the element to click, because there's also an inside canvas, upper canvas, lower canvas, and so on? 2. What did you base the x and y offset on? 3. With the code you provided, the textarea (triggered by clicking twice) does not appear. But it does seem if I click manually to make the textarea appear, I can 'unclick' the element by running your code.
          – DaReal
          Nov 14 at 19:11




          Hi Kamal, 3 questions: 1. how do you know which is the element to click, because there's also an inside canvas, upper canvas, lower canvas, and so on? 2. What did you base the x and y offset on? 3. With the code you provided, the textarea (triggered by clicking twice) does not appear. But it does seem if I click manually to make the textarea appear, I can 'unclick' the element by running your code.
          – DaReal
          Nov 14 at 19:11




          1




          1




          1. I was trying to click on the position where canvas has the text and is clickable. I was able to do the same using 'canvas-container' div element(as mentioned in answer), 'inside-canvas' canvas element and 'lower-canvas' canvas element because all of them are in same position.
          – Kamal
          Nov 15 at 5:07




          1. I was trying to click on the position where canvas has the text and is clickable. I was able to do the same using 'canvas-container' div element(as mentioned in answer), 'inside-canvas' canvas element and 'lower-canvas' canvas element because all of them are in same position.
          – Kamal
          Nov 15 at 5:07




          1




          1




          2. move_to_element_with_offset will take the top-left corner of the element as start point and move as per the offset given. I manually checked how much offset I need from top-left corner of canvas to reach the text. I think this could be the reason why it did not work for you. May be the offset will change based on screen size. 3. I think somehow the double click is behaving as single click in my case also, so I clicked once, then clicked again after 1s and it worked. I have updated the answer with that.
          – Kamal
          Nov 15 at 5:07






          2. move_to_element_with_offset will take the top-left corner of the element as start point and move as per the offset given. I manually checked how much offset I need from top-left corner of canvas to reach the text. I think this could be the reason why it did not work for you. May be the offset will change based on screen size. 3. I think somehow the double click is behaving as single click in my case also, so I clicked once, then clicked again after 1s and it worked. I have updated the answer with that.
          – Kamal
          Nov 15 at 5:07














          Perfect, it took some tries to get the x and y offset for my screen, but it works! Thank you for the explanation as well. So originally it didn't work for me because I could not find the right element and was clicking on non-clickable areas.
          – DaReal
          Nov 15 at 19:35




          Perfect, it took some tries to get the x and y offset for my screen, but it works! Thank you for the explanation as well. So originally it didn't work for me because I could not find the right element and was clicking on non-clickable areas.
          – DaReal
          Nov 15 at 19:35


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242092%2fdouble-click-visual-element-not-in-html-to-make-textarea-appear-selenium%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Florida Star v. B. J. F.

          Error while running script in elastic search , gateway timeout

          Adding quotations to stringified JSON object values