I am managing many accounts CMS, Google account and ETC. My new project is making automated account creation system so that I can spend less time to do boring works.
You can imagine that type just name and email address in the form, it will open browser and open chrome browser and go google admin account page and click create new and adding the typed information accordingly. Then go to CMS account page and create an account in the same way. Wonderful, I can save couple minutes or even an hour DAILY!
Selenium is browser automation solution.
To install this it need some preparation
First install Xcode. Open App store and search for Xcode, download and install.
Another one is Homebrew. This makes installing software a lot easier. Open terminal and type this.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Now, install node.
brew install node
Then Install chrome driver.
brew install chromedriver
Make webdriver home folder and install selenium-webdriver.
mkdir webdriver cd webdriver npm init -y npm install -S selenium-webdriver
Note that there were error, without init npm. I got an error like ‘missing package.json warnings and errors off’. So I ran “npm init -y”. This will create package.json file.
Now everything is prepared.
Are you ready for launching new browser? Go!
Type node. And command like this order.
$ node var webdriver = require('selenium-webdriver'); // Open Chrome Browser var driver = new webdriver.Builder().forBrowser('chrome').build(); OR var driver = new webdriver.Builder().withCapabilities(webdriver.Capabilities.chrome()).build(); // Open google.com driver.get('http://www.google.com');
Then browser opened and open google home page.
Now create js file which includes all the commands like this. I have created open_browser.js file using below commands.
And Run js file.
node open_browser.js
Working good. I will post how to login to google account for next step.
Will this makes me lazy? Not sure!