From: Dominique de W. <dde...@gm...> - 2007-09-28 10:08:36
|
We are writing stuff to support execution of selenium scripts on htmlunit. The case I am trying to solve now is that of loading a static page which contains an iframe where the application loads its stuff and finding elements of this iframe... The script recorded with selenium-IDE simply visits the page, which loads the application part into the iframe, then tries to select an element (a selectbox) which is in the iframe. open mypage assertTitle myPage select dropDownInIframe Those step execute directly with SeleniumIDE as if the iframe DOM were directly available. However, when doing this trivially, all I have in html is the iframe element but not its contents.... How do you think I should go about supporting this iframe handling with htmlunit? Thanks for you help. D. |
From: Marc G. <mgu...@ya...> - 2007-10-01 15:25:01
|
Dominique de Waleffe wrote: > We are writing stuff to support execution of selenium scripts on htmlunit. ??? what would be the interest? > The case I am trying to solve now is that of loading a static page which > contains an iframe where the application loads its stuff and finding > elements of this iframe... > > The script recorded with selenium-IDE simply visits the page, which > loads the application part into the iframe, then tries to select an > element (a selectbox) which is in the iframe. > > open mypage > assertTitle myPage > select dropDownInIframe > > Those step execute directly with SeleniumIDE as if the iframe DOM were > directly available. > > However, when doing this trivially, all I have in html is the iframe > element but not its contents.... not sure to understand. If a page contains an iframe tag, then it won't contain the code located in this iframe. To see the content of the iframe you have to look at the enclosed window and at its enclosed page. This is is nothing special to HtmlUnit, you have exactly the same when you look at the page source in your "normal" browser. > How do you think I should go about supporting this iframe handling with > htmlunit? iframe is supported since a long time ;-) Marc. -- Blog: http://mguillem.wordpress.com |
From: Dominique de W. <dde...@gm...> - 2007-10-01 16:16:52
|
Thanks for answering. On 10/1/07, Marc Guillemot <mgu...@ya...> wrote: > > Dominique de Waleffe wrote: > > We are writing stuff to support execution of selenium scripts on > htmlunit. > > ??? > what would be the interest? Our interest is running selenium recorded scripts on TestMaker (which embeds htmlunit). I know that you (and others) are not fond of those automated recorded scripts. However, it is still a good way to capture a first shot of a script, doable by a user or business analyst, then revised and completed by testing specialists for load testing. > The case I am trying to solve now is that of loading a static page which > > contains an iframe where the application loads its stuff and finding > > elements of this iframe... > > > > The script recorded with selenium-IDE simply visits the page, which > > loads the application part into the iframe, then tries to select an > > element (a selectbox) which is in the iframe. > > > > open mypage > > assertTitle myPage > > select dropDownInIframe > > > > Those step execute directly with SeleniumIDE as if the iframe DOM were > > directly available. > > > > However, when doing this trivially, all I have in html is the iframe > > element but not its contents.... > > not sure to understand. If a page contains an iframe tag, then it won't > contain the code located in this iframe. To see the content of the > iframe you have to look at the enclosed window and at its enclosed page. > This is is nothing special to HtmlUnit, you have exactly the same when > you look at the page source in your "normal" browser. The thing is that running the above under Selenium IDE does not require anything special, just as if upon failure to find the element, Sel was looking into the frame on its own. I have not looked at the code of Sel.-IDE....so I am guessing... > How do you think I should go about supporting this iframe handling with > > htmlunit? > > iframe is supported since a long time ;-) I did not say (nor mean to say) iframe was not supported. Anyway, I found out that I could manually add a selectFrame() selenium action and implement this type of action in my mapping from Selenium to htmlunit... so much for the recorded original :-( So I have solved (sufficiently for now) this issue. I have another one with ajax requests and the (a)synchronous AjaxController but that will be the subject of another mail.... Cheers, D. |