For Advanced

Lesson 1/10

Vital Selenium

Now, since you know the basics, it’s time to leverage some important and unique features of G1ANT.Language. Let’s try the commands that master the Internet — starting with the ones, which communicate with browsers.

The selenium.click command is used to click an element on a webpage that was open using the selenium.open command. Both commands are provided by the Selenium Addon, so in order to use them, you need to enable the addon in the Addons panel to the left of the script editor: just click the check box next to the selenium entry to select it.

Run this script:

selenium.open chrome url google.com
window ✱Google✱ style maximize
selenium.click search gb_70 by id

You can see your Chrome browser launched and the Google search page opens (the selenium.open command in the first line), then the browser window is maximized (the window command). Finally, the Google Account login page is displayed, because the selenium.click command clicks the Sign In button in the top right corner of the page.

But wait, what does the search gb_70 by id mean? It’s an “address” of an element (the Sign In button in this particular case) in a webpage’s source code. In the next lesson you will learn how you can get it.