Archive | January, 2013

git push heroku master

31 Jan

Still feasting on the Rails tutorial.  You can see the current state of the demo app I’m working on here.  Down the road I’ll be doing something simple but of my own design, which will be interesting.  For now, though, I’m following the path as laid out by the tutorial.

Advertisements

More on Rails…

28 Jan

I’m a bit disappointed with the tutorial I tried on Udemy for learning Rails. The instructor is doing his best and clearly understands Ruby and Rails a great deal, but lacks the talent for organizing and imparting information that I have found with the Java Selenium course mentioned in earlier posts.

However, it gave me an experience and some exposure, and a LOT of questions, many of which I wasn’t even quite sure how to articulate. Rather than give up (not an option) I did some searching for other online tutorials to augment what I was learning on Udemy. What I found surpasses it so thoroughly that the Udemy tutorial is no longer in the running.

This tutorial is free and very up to date, and can be found here:

http://ruby.railstutorial.org/book/ruby-on-rails-tutorial

It’s very popular and highly regarded with good reason. It kicks BIG ass!

It starts briefly with the usual demo using rails ‘scaffolding’, which basically implements a metric ton of ‘crud’ functionality with a single line of code. Very impressive, and a great way to see, at a gulp, what a basic Rails app looks like and where things are. With the next chapter, however, the training wheels are taken off and the learning really begins. This is where the Udemy class really began to lose me (and probably a lot of other folks). The Udemy course stuck with the scaffolding approach and pretty much assumed you understood it all from that point on. Understanding came, of course, in dribs and drabs with lot’s of outside references and web searches, and that can be a powerful way to learn, but also poorly focused and quite frustrating at times.

The railstutorial.org material is very well structured and thought out, giving you the experience, in short order, of creating a base app, setting up git to store versions in a repository, and setting up a Heroku account and uploading the app there to actually see it there. To it’s credit, the Udemy course started out the same way and was very satisfying.

The rails tutorial.org approach goes into much more detail at every step, however, and being HTML itself I found it very easy to refer to earlier sections to clarify my understanding of something and then jump back to where I was, making for a much smoother flow in terms of learning and doing.

There’s just no comparison. If you want to get a look at Rails just to see what it’s all about, go through chapters 1 and 2 of the rails tutorial. If you want to go deep, just keep on going! There are exercises (which you should do) as well as optional challenges (such as configuring PostgreSQL for testing and development instead of the easier default of SQLite) that are well worth exploring.

It also gets into TDD and BDD early in, in a practical way (using just Rspec at first) and then keeps re-visiting it as the course goes on, which really helps to drive home how it feels to really *do* test and/or behavior driven development. Much better than a discrete tutorial that tells you ‘here’s how it’s done’ and then never mentions it again.

It feels great to be learning so much about so many different things (they’re all ‘interwingled’ as an old tome on computer science used to say), even if I probably won’t be mastering any of them overly soon.

All we can do is…keep going!

ENVY this website!

23 Jan

A top-notch web site, full of flash and functionality, created with Ruby on Rails by a master developer with truly fearsome skill(z).

No, really!

Click here and feast your eyes. Line forms to the left for those wanting similar expertise applied to their own sites. Money talks and all that.

The glitz! The Software Quality. The fine engineering and craftsmanship.

It hurts the eyes, no?

Be Alert

22 Jan

Why?

Because the world needs more Lerts, that’s why.

2nd confession:

I kind of…lied…earlier. I’m more like 45% through the course, not 50%!

Honest Lerts.

Yes. What the world really needs is more Honest Lerts.

So be alert already.

Confession…

22 Jan

I’m officially 1/2 way through the Udemy course on Selenium, and it’s already taught me a TON about both Selenium and Java, as well as gotten me very comfortable with the IntelliJ IDE.

That said, I’m getting a bit exhausted.

After a bit of thought, I’ve decided to add to my workload rather than subtract. I’ve been wanting to learn more about Ruby and Rails, and so I have signed up for another course at Udemy teaching, you guessed it, Ruby on Rails.

It’s a fair reward, I think, for getting as far as I have with Selenium and Java, and will give me something constructive to do when the Selenium training needs a break.

So you’ll probably be seeing some Ruby / Rails tidbits here in addition to the Selenium stuff. Lucky you!

WebDriver user interactions issue…solved!

18 Jan

I ran into a snag with an exercise from the Udemy site for Selenium involving user actions.  The ‘Actions’ class in Selenium lets the automation model the behavior of a user sitting at the keyboard to type things in, click, drag and so on.  Fine.  What was occurring with firefox was, when the browser came up and the ‘user’ started typing, the typing went into the address bar of the browser instead of the browser page itself.  At the time I was trying to type ‘ctrl-b’ to prompt a change in one of the page elements, but this wasn’t occurring.

I knew I had to get that page in focus, but was not having success doing so.  Finally, after a bit of searching on the web, I came across a solution that works and is very simple.

Before entering any text using the Actions object, perform the following:

driver.findElement(By.tagName("html")).click();

That’s it.  That code performs a simple click on the background of the base html page which changes the focus appropriately.  From that point on, my Actions code worked like a charm.

still at it

15 Jan

My cold had a wonderful weekend at my expense, which cut down drastically on my Selenium learning productivity. Feeling much better now so we’re back in the saddle (or the basement, really) and finishing up the section on manipulation with some reviews and a bit of experimentation.

I have become especially fond of a technique in IntelliJ (and I’m sure Eclipse) which lets you refactor and extract a method from a selected chunk of code. For the bits of code that get repeated often this can make your test code much more readable.

You can right-click > Refactor > Extract > Method, or just type ‘CTRL-ALT-M’. Be sure and have the desired code selected before hand of course.