Prime Faces editing component and Selenium



  • 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



  • 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



Suggested Topics