applescript getElementsByName in Chrome I need to fill up a text field and click on a button on Google Chrome

Here is my script for safari.

tell application "Safari"

## tell window 1 of application "Safari" to set current tab to tab 1
-- Last Name
do JavaScript "document.getElementsByName('0.7.7.7.7.7.5')[0].value=" &amp; quoted form of theProfil &amp; "" in tab 1 of window 1
-- search
delay 0.1
do JavaScript "document.getElementsByName('0.7.7.7.7.1.7')[0].click();" in tab 1 of window 1


How can I use this (getElementsByName) with Chrome ?

cheers.
Google Chrome is scriptable through the Chromium suite—the execute method is what you're looking for. Here is an example of your code, re-written for Chrome:

tell application "Google Chrome"
    execute front window's active tab javascript  "document.getElementsByName('0.7.7.7.7.7.5')[0].value=" &amp; quoted form of theProfil &amp; ""
    delay 0.1
    execute front window's active tab javascript "document.getElementsByName('0.7.7.7.7.1.7')[0].click();"
end tell


See this question on Stack Overflow for reference, or consult the Google Chrome AppleScript dictionary (in Script Editor, click File > Open Dictionary… and choose Google Chrome).