After reading the switch-to-iframe documentation, I am still not sure what will driver.getPageSource() return after driver.switchTo().frame(frame element) is called.
By Page source, I refer to the definition in getPageSource(). But I can't find anything that confirm src's attribute is the same as page source. I think during the switching, webdriver will send a request to the src url and use the response to create a page source for the iframe, is it correct?
Is an iframe src's attribute the address for storing its page source? In here, it says
The src attribute specifies the address of the document to embed in an iframe.
(1) Anyway, let's say if we have an iframe like below
#document ----> may or may not exist, not sure if #document create by src or not
When the driver switch to this iframe,
Is the "/video.mp4"'s content use to create the iframe's page source (I think page source is the #document)? But this is a video file, how is it possible to use a video as page source (html)?
Or the page source is "/video.mp4"'s conetent + #document?
(2) What if the iframe has a html as src, such as
#document ----> may or may not exist, not sure if #document create by src or not
Does the page source become whatever is in file.html PLUS the #document in iframe? Or the #document will only be created using the content from file.html after driver is switch?
(3) If the iframe has no src, such as
Can the iframe still has page source? What will getPageSource() return in this case after driver switch to this iframe?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)