Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I'm creating a new tests with selenium in my job. But i can't get one element in my system. We use Prime Faces and i can't get this element. I need to send a value to him, and He is a iFrame.

I tried to use Selenium IDE but i had no success. When I try to get the xPath, i get /htm/body :( Someone know how i can get the full path of this element?

I'm using Selenium Web Driver.

Thanks in advance

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

after a little searching, I found this solution

driver.switchTo().frame(find(By.id("id_frame")));
find(By.xpath("/html/body")).click();

WebElement editable = driver.switchTo().activeElement(); 

editable.clear();
editable.sendKeys("Your text here"); 

driver.switchTo().defaultContent();
find(By.xpath("btn_save")).click();

worked very well

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.