Running javascript inside a title tag in Selenium RC

I want to run a javascript fragment inside a tag <head>. Is it possible to do this in Selenium RC + Java?

I realized that if I use getEval or runScript, which will embed code inside the body of the HTML.

Any ideas?

thank

+3
source share
1 answer

I understand that by the time Selenium can interact with the page, it is already loaded, which means that you cannot add something to the <head> element.

You can use runScript to dynamically add a script tag to the head element using the DOM manipulation methods, but this is probably not what you are after ...

0
source

Source: https://habr.com/ru/post/1747296/


All Articles