AnsweredAssumed Answered

Interacting with elements within Iframes in BWC modules, using Selenium Webdriver

Question asked by on Sep 30, 2015
Latest reply on Oct 6, 2015 by
Hello, I am trying to locate elements inside Iframes in bwc modules, but apparently something goes wrong.
To do this i wrote this code:
driver.findElement("name")).sendKeys("testing name");
Unfortunately i am getting this error: 

Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"id","selector":"name"} 

Also i added an explicit wait before 2nd line, just to try. Like: 
However i get a similar error message:

Exception in thread "main" org.openqa.selenium.TimeoutException: Timed out after 30 seconds waiting for presence of element located by: name

When i saw this problem, i checked the behavior using selenium IDE, writing this test case:
<tr> <td>selectframe</td>
<td>testing name</td>
I could access to the element within Iframe using selenium IDE perfectly.

Given this scenario, I tried by saving the page to an html. Then I located this html and the related files outside from a sugarcrm environment, into my document root (i'm using MAMP).
By the way, my SugarCRM is installed under the same document root.

Once i did this, i executed the test again with selenium webdriver and this html, just changing the url. At this point selenium webdriver is able to find and interact with elements inside frames with the same code that failed at first under a SugarCRM environment.

I don't know what is going wrong, why selenium webdriver is unable to find and interact with elements inside iframes in a bwc modules?