[Webtest] Re: 6. Re: javascript link (Denis N. Antonioli) #1856 - 2 msgs

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Mon, 04 Jun 2007 09:19:39 +0200


Francisco,

what is failing here is your storeRegEx step, meaning that the link is
not clicked and you can't say anything concerning the javascript execution.

In most cases it is a bad idea to extract an url and invoke it: links
are there to be clicked!
To determine how to click the link, you have to exactly know why you
want to click it. Is it due to the content within the <a ..>...</a>? Or
to some information before it? After it? Once you've answered it, you
can choose how to identify the link within <clickLink .../> and in worst
case, xpath allows to select you anything in the page.

Marc.

Francisco Javier Martin Gutierrez wrote:
> Hello:
> 
> Thank you about suggestions. I tried but I think that it is some kind of
> unsupported javascript. I have proven a lot of regular expression but any of
> them works. You can see the output below:
> 
> [clickLink]  WARN (com.gargoylesoftware.htmlunit.html.HtmlPage) - Expected
> content type of text/javascript or applicatio
> n/x-javascript for remotely loaded javascript element
> http://192.168.43.27:7783/sauss/js/sauss.js but got [application/o
> ctet-stream]
> ...
> 
>  [clickLink] DEBUG (com.gargoylesoftware.htmlunit.javascript.host.Window) -
> No configured setter "lista" found for com.ga
> rgoylesoftware.htmlunit.javascript.host.Window@106e02e. Setting it as pure 
> [clickLink] DEBUG (com.gargoylesoftware.htmlunit.javascript.host.Window) -
> No configured setter "eliminar" found for com
> .gargoylesoftware.htmlunit.javascript.host.Window@106e02e. Setting it as
> pure javascript property.
> [clickLink]  INFO (com.canoo.webtest.engine.WebClientContext) - Content of
> window changed to http://192.168.43.27:7783/s
> auss/ValoracionesFavoritas.do (text/html)
> [clickLink]  INFO (com.canoo.webtest.engine.WebClientContext) - Content of
> current window changed, it will become curren
> t response
> [clickLink]  INFO (com.canoo.webtest.engine.WebClientContext) - Current form
> set to none
> [clickLink]  INFO (com.canoo.webtest.engine.WebClientContext) - Current
> response now: http://192.168.43.27:7783/sauss/Va
> loracionesFavoritas.do
> ...
>    
> [verifyText]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
> verifyText "Texto presente: 10101A" (54/56)
> [expectDialog]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
> expectDialog "Esta seguro que desea eliminar la v
> aloracion..." (54/56)
> [storeRegEx]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
> storeRegEx "Extract target location from javascript
>  command" (54/56)
> [storeRegEx]  INFO (com.canoo.webtest.steps.Step) - Running with: Canoo
> Webtest: R_1561.
> [storeRegEx]  INFO (com.canoo.webtest.steps.Step) - Exception thrown from
> this class: com.canoo.webtest.engine.StepFaile
> dException
> [storeRegEx]  INFO (com.canoo.webtest.steps.Step) - Message was: No match
> for regular expression <.*name="href".*href="j
> avascript:eliminar(10101A, prueba marcos)>
> 
> 
> I think that it has not solution so I am going to leave it. This link <a
> href="javascript:eliminar('10101A', 'prueba marcos');"> is too much for me. 
> 
> Thank you again.
> 
> THALES
> Francisco Javier Martín 
> Desarrollo de Proyectos - Valladolid
> Security Solutions & Services Division 	
> 	 
> Edif. Solar, Of. 13, 14, 15
> Parque Tecnológico Boecillo. 47151 Valladolid. España
> Tel.: 983 54 65 55   Fax: 983 54 66 09	 

-- 
Blog: http://mguillem.wordpress.com