0

I am trying to access the Iframe from the CKeditor implemented in our application. Using selenium based Javascript testing. I am able to detect the iframe. But, not able to find the contents or HTML tags in iframe.

I am using the following code to test the iframe using class and based on title in the iframe. I am checking is it the right frame I am targeting.

  const visibleIframe = driver.wait(
    until.elementLocated(By.className('classTest')),
   TEST_TIMEOUT
  );
  return visibleIframe.getAttribute('title');

Now, I want to get into Iframe to test the contents in the "body" tag. I need to add text or contents into it using sendkeys and get the content for testing.

Mukesh Soni
  • 6,646
  • 3
  • 30
  • 37
Deepak
  • 305
  • 1
  • 6
  • 18
  • You have to switch to iframe contents `driver.switch_to.frame(iframe)` where `iframe` have selector in it, in your case it would be `driver.switch_to.frame("classTest")` Once done with your work in iframe use `driver.switch_to.default_content()` to access original contents of page – Ayyan Khan Aug 13 '19 at 10:06
  • switchTo.frame() method doesn't exists, when I try to access in code intellisense on visual code. I can't access any methods mentioned. – Deepak Aug 13 '19 at 11:20

0 Answers0