Tips for Interns from a Former Intern

This blog post would be better suited if I wrote it in the beginning of the summer but whoops. I’ve been working full-time at Personal Capital for over two months now. Last summer I interned here and in this post I’d like to share to all current and future interns some tips to maximize their internship experience.

tl;dr Summary:

  1. This is your time to shine. Show them what you got!
  2. Always be eager to learn and ask how to improve.
  3. Seek out help if you need it.
  4. Dabble in different things.
  5. Go out to lunch.
  6. If you’re interested in returning, let them know!

1- This is your time to shine. Show them what you got!
Congrats! You made it past the interviews, offered an internship, and now spending the next couple of months working for them. This is an audition for both sides. They’re trying to further evaluate your skills and how you interact with others. From your perspective you want to see if this is a company that you see yourself working for after college.

2- Always be eager to learn and ask how to improve.
You’re probably the youngest person in the company. You’re surrounded by people with years of experience who have been through a lot. You can learn so much from them! Also soliciting feedback on the work you’re doing is very helpful in developing you, the professional.

3- Seek out help if you need it.
If you’re stuck on something or just don’t understand the task/problem at hand be sure to ask questions. There’s no such thing as asking too many questions. You might spend a lot of time on something that was not needed or wrong. I’m sure your supervisor would rather take a little time in the beginning to ensure you don’t spend unnecessary time down the road.

4- Dabble in different things.
This is your opportunity to try out something you don’t really know about. Some companies will differ in how much you can explore outside what you’re brought into do, so your mileage may vary on this one. Every company has many projects happening or want to happen, and this is your chance to see if it’s what your passionate about.

5- Go out to lunch.
You’re surrounded by many fascinating people, all with different backgrounds and journeys they took to get where they are today. Unfortunately in the office we’re just so focused on the task at hand that we really don’t get to know the people we work with. Grabbing lunch is an excellent opportunity to really get to know about them. Be it one-on-one or a group; I know I really enjoyed “Lunch Crew” when I was an intern.

6- If you’re interested in returning, let them know!
Lastly if you are interested in working there in the future, communicate that towards the end of your internship. After having a great time last summer I spoke with our Ehsan, our VP of Engineering, and was fortunate to be offered a full-time position after graduating. I’m not alone. According to the National Association of Colleges and Employers (NACE) 2015 survey, employers converted 51.7 percent of their interns into full-time hires. You can be a part of the majority!

That’s it! I hope you enjoyed this post and find it useful!!

Web Automation Testing

This summer I have the privilege of working as an Engineering Intern at Personal Capital. Not only do I have the pleasure of working with really great people, I am also learning about how various engineering teams come together to build an awesome product. There is only so much you can learn in a classroom; this is the real world we’re talking about!

My main project is implementing an automated test suite for Personal Capital’s marketing website and web app. Automated tests make the feedback loop faster, reduce the workload on testers, and allows testers to do more exploratory and higher-value activities. Overall, we’re trying to make the release process more efficient.

Our automated testing stack consists of Selenium WebDriverJS, Mocha + Chai, Selenium Server, and PhantomJS. Tests are run with each build by our continuous integration tool Hudson, and we can mark a build as a success or fail based on its results. Our tests are written in JavaScript since our entire WebUI team is familiar with it.

In an effort to keep our test scripts clean and easily readable, Casey, one of our Web Developers, ingeniously thought of creating helper functions. So instead of having numerous driver.findElement()’s and a chai.expect() throughout our scripts, these were integrated into a single function. An example of a one is below.

var expectText = function(selector, text) {
	scrollToElement(selector).then(function(el) {
		chai.expect(selector).dom.to.contain.text(text);
	});
};

We were having issues when testing in Chrome (while Hudson runs PhantomJS, our tests are written to work in Firefox, Chrome, and Safari) where elements weren’t visible so we need to scroll to their location first. We then have our scrollToElement() method that is chained with every other helper function.

var scrollToElement = function(selector) {
	var d = webdriver.promise.defer(),
		el;

	// Get element by CSS selector
	driver.findElement(webdriver.By.css(selector))
		// Get top and left offsets of element
		.then( function(elt)	{
			el = elt;
			return elt.getLocation(); 
		} )
		// Execute JS script to scroll to element's top offset
		.then(	function(loc)	{ 
			driver.executeScript('window.scrollTo(0,' + loc.y + ')');
		} )
		// If successful, fulfill promise.  Else, log ERR
		.then(	
			function(success)	{ 
				d.fulfill(el);
			}, 
			function(err)	{ 
				d.reject('Unable to locate element using selector: ' + selector);
			} );

	return d.promise;
};

Then a typical test script would look like this:
helper.clickLink();
helper.expectText();
helper.enterInput();
Super clean, simple, and awesome. Anyone can write an automation script!

One of the main challenges in automation is timing. Some browsers (I’m looking at you Chrome) are faster than others, and the driver will attempt to execute commands before elements on the page can be interacted with. So to overcome this we used a mixture of implicit and explicit waits. There are two ways to do an implicit wait. The first is setting WebDriverJS’s implicitlyWait() by having the following line of code after defining the driver:

driver.manage().timeouts().implicitlyWait(1300);

This is global, so before throwing an error saying an element cannot be found or be interacted with, WebDriverJS will wait up to 1.3 seconds. The second method is waiting for an element to be present on the page, and setting a timeout. This is helpful if we need more than 1.3 seconds on a certain element. We have a helper function called cssWait() that looks like this:

var cssWait = function(selector, timeout) {
	driver.wait(function() {
		return driver.isElementPresent(webdriver.By.css(selector));
	}, timeout);
};

On top of those we use explicit waits that are simply “driver.sleep(<time>)”. Sometimes we need to hard code a wait to get the timing just right.

Unfortunately that’s it for this post. If you have any questions feel free to leave a comment and I’ll get back to you. In my next blog post, or one that will be written by Aaron, I will talk more about some of the challenges we faced and how we dealt with them.

To get started with Web Automation, I suggest heading over to SimpleProgrammer.com where John Sonmez put together some instructions on getting your environment set up. While his are for Windows, the Mac version is pretty similar.