Working with frame in Page Object Model using Selenium Webdriver
277 views
Skip to first unread message
devesh bhatt
unread,
Sep 3, 2015, 11:02:58 AM9/3/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to webdriver
How would be work with frame in page object model with TestNG Framework in selenium Webdriver?
darrell
unread,
Sep 10, 2015, 12:14:37 PM9/10/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to webdriver
It depends on how you define a 'page'. Generally speaking, a frame is another DOM. When you look at the DOM you will see that the <iframe> tag actually contains <html> ... </html>. Since tools like Selenium need to switch to the frame to be able to interact with it, it makes sense to treat it as a separate 'page'. When you instantiate the 'page' you need a method for how you 'switch' to the page. For actually different pages you use the driver.get() to switch to the page. For frames you use driver.get() to switch to the parent page then use switchTo() method to switch to the frame.