Wednesday, July 11, 2018

Python Webdriver and the Page Object Model

Image result for technical workshops

Welcome to my new blog where I will be discussing Python Webdriver and the Page Object Model and the tools you will need to help make you an effective automation engineer.

Getting Started
Tool set that I currently use:


  • PyCharm IDE - https://www.jetbrains.com/pycharm/
  • Pandas - Pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming - https://pandas.pydata.org/
  • Selenium WebDriver - https://pypi.org/project/selenium and http://selenium-python.readthedocs.io/api.html
  • Chromedriver 2.40 - http://chromedriver.chromium.org/downloads
  • Chrome v66 - https://www.google.com/chrome/
  • Numpy  - www.numpy.org/
  • Beautiful Soup - http://www.pythonforbeginners.com/beautifulsoup/beautifulsoup-4-python











Friday, August 26, 2016

South Dakota - Other Pics - Post Trip Pics

Needles Highway, SD













Custer State Park, SD



Deadwood, SD



Spearfish Canyon - such a beautiful area to ride

Mount Rushmore - What a sight to see!!









Thursday, August 25, 2016

Sturgis, SD - Post Trip Pics

We finally made it to Sturgis, it was a fun time, after which we headed off  to the new all metal Full Throttle Saloon. Zak Wilde with Black Label Society was taking the stage later that night which turn out to be an awesome show!

















Wednesday, August 24, 2016

The BadLands - post trip pics

We finally made out to South Dakota








Now on our way to Howard Johnson's Rapid City where we will be staying for the week.











HoJo's always had Happy hour was definitely the happiest hour ever



One of our first rides was to head to the badlands from Rapid City the temp was 80 in the morning and heading well past the 100+  in the afternoon










Our first drink stop a great little place in the middle of nowhere. It was a cool place with 1 dollars bills with names of others that have made the trek.












The landscape was unlike anything I have seen before









Wednesday, July 13, 2016

Count Down to Sturgis 2016

We started planning our trip in Feb of 2016, reserving a Hotel (Howard Johnson's) in Rapid City and transportation out there for the Motorcycle 1986 Harley FXR.



But as fate would have it I lucked out and a bought a new 2016 Street glide 103cc an decide my wife and I would ride it out from Boston to Sturgis, South Dakota and back.



As of today the Official count down 

As it is getting closer we are gearing up and getting the bike ready for  the trip. I have just purchased and installed the following:

  • 4 point docking hardware 
  • Detachable Sissy bar, pad and hardware
  • Touring seat from my good friend Tony (paying soon)
Needed still is:
  • Luggage rack
  • Luggage bag (generic - non harley)
  • Maintenace ( July 22 appointment)
  • Tank bag for maps, iphone, etc.
The planning of the trip is going well the route has be planned out although places to stay for the night have not been booked, it all depends on different variables along the road as contructions traffic and general fatique from riding.

We expect to do 600-700 per day depending again based on variables such as road conditions, traffic and weather. Hopefully our target will be somewhere in the middle.

We looking forward to this adventure both the mental and physical challenges it will be bringing.

Stay tuned!....

Tuesday, February 9, 2016

Back to PAMIE

 (Python Automation Module for Internet Explorer)


PAMIE was my first Python project ever and it's still  quite a hack, but for the most part it does it's job automating Internet Explorer. Although there are other tools out there such as Selenium, I have decided to pick up the ball and see what I can add to PAMIE to make it a robust test tool for website automation and webscraping.

The first thing I had to do was to refactor the code a bit for Python 3.x. The next step is to break up the code up to easier manageable pieces. Help speed it up a bit using list comprehensions and other code tricks.

There were a few bugs I fixed in the latest update but the next release will be a little a ways off. I will be checking in code for those that want to get the latest and muck around with it, but I guarantee it will be a bit flaky.

For those interested try here http://pamie.sourceforge.net/

Thursday, October 11, 2012

The Corn Stock Chronicles

We will be heading out to Des Moines for vacation soon this should be a fun adventure. Will keep you posted!!


Sunday, August 15, 2010

Time to Visit the Harley Gods

It's 9 am and we are heading to the Temple of Harley-Davidson - (pics to come)

Saturday, August 14, 2010

Night Time Fun!!




We took a walk around Milwaukee, I have to say this is the cleanest city in the U.S for sure.

Below is a few pictures we took.




Day One Milwaukee



We got a great room a the Hyatt Regency, actually the least expensive downtown.




View from the Room




We Had lunch on the water at Rock Bottom, awesome,place, food and beer!!
This is the view of where we were sitting.




Tuesday, August 10, 2010

Road Trip 2010 - Rob and Autumn's Cross Country Redneck Adventure!










Harley-Davidson Museum in Milwaukee, WI


Planning a road trip to visit the Harley-Davidson Museum in Milwaukee, WI and the Iowa State Fair a couple days later.

This is a one week trip so we will be moving fairly quickly to see everything.













Iowa State Fair 2010

This will be our first time visiting the fair so we are not sure what to expect but it should be fun!
Looks like it's going to be quite the family adventure!

Thursday Aug- 12 2010 - The Day Before:
It's Thursday and we are already gearing to go.
Getting every thing in order. Hotel in Milwaukee is already paid for so
we know we have a place to crash when we get there.

I will be backing up the car tomorrow while Autumn works
Then at 5pm sharp we are on our way!!

Friday Aug-13-10
Counting down to take-off. Finished changing the oil and filter, Car is 3/4 packed a few last items left. Soon as Autumn gets out of work we will be on our way. I will post pictures of our trip each day soon check back soon!!

Tuesday, February 9, 2010

Selenium - Handling Dialogs with Python

I am currently scripting Selenium tests using Python (selenium.py)
One of the main issues I have found are looping, parametrization and handling modal dialogs

Dialogs:

Dialog boxes are invisible to selenium, it just can't see them.
The reason is the dialogs are native to the operating system you are running.
Selenium only identifies the web components (elements)

In Internet Explorer I created a work around for handling dialogs in Python such as File Download, SaveAs, Save and Close. This workaround could also be used for other dialogs.
Although this may not be the most elegant method it works for me.


import os, sys, time
import win32com
from pywinauto import application
import winGuiAuto as wga
import time
import SendKeys
import win32gui
import win32con


###############################
class AutoTools:
def __init__(self):

self.app = application.Application()


def clickFileDL(self):
"""
Find the Download Dialog and Click "Save"
"""
time.sleep(5)

# Draw and Outline so I know it's the right control and give focus to the control
self.app.FileDownload["&Save"].DrawOutline()
time.sleep(1)
# Click the Save Button
self.app.FileDownload["&Save"].ClickInput()
time.sleep(1)
# Get a Handle to the File Download Window by title
hwnd = wga.findTopWindow(wantedText="File Download")
time.sleep(1)
# Simulate Mouse Down and Mouse Up
win32gui.SendMessage(hwnd, win32con.WM_LBUTTONDOWN, 0, 0)
# Important timing issue between clicks
time.sleep(2)
win32gui.SendMessage(hwnd, win32con.WM_LBUTTONUP, 0, 0)
#
SendKeys.SendKeys("""{ENTER}""")

def clickSaveAs(self):
"""
Find the Save As Dialog and Click "Save"
"""
time.sleep(1)
self.app.SaveAs.PrintControlIdentifiers()
self.app.SaveAs.ComboBox3.Select("All Files")
# Find the Save As Dialog and Click "Save"
self.app.SaveAs.Save.DrawOutline()
time.sleep(1)
self.app.SaveAs["&Save"].ClickInput()
time.sleep(1)
SendKeys.SendKeys("""{ENTER}""")


def clickDLClose(self):
"""
Find the Downloadcomplete Dialog and Click "Close"
"""

time.sleep(1)
# Find the Download complete Dialog and Click "Close"
time.sleep(2)
SendKeys.SendKeys("""{ENTER}""")

#########################################

Refs:
http://pywinauto
.openqa.org/

http://www.brunningonline.net/simon/blog/.../winGuiAuto.py.html


Next I will explain how to use Autoit with FireFox to handle dialogs...

Sunday, December 27, 2009

Selenium and Python

I have been working on Selenium at my latest project and I found that selenium of course is not capable of controlling IE dialogs such as File Download and SaveAs. So far in Python I have been able to work around this but using a combination of pyWinAuto.py,SendKeys and winGuiAuto

You have to get focus to the control, Send and Up/down mouse command and and "ENTER" command. I have know idea why it takes all those commands but it works.

I have also written a reporting tool for Selenium that show how many test have been run and the results in HTML format.

Selenium is nice if you have to automate many browsers such as IE and Firefox.

Friday, April 17, 2009

Working with WinForm dataGridViews and QuickTest Pro

With Quick Test Pro I found the example below works the best when you want to select and click the cell.

' Select the cell row 0 column zero
SwfWindow("myForm").SwfTable("dataGridView1").SelectCell 0,0

' Click the cell row 0 column zero
SwfWindow("myForm").SwfTable("dataGridView1").ClickCell 0,0

Minimize the QuickTest Pro window

Here is a quick way to Minimize the QuickTest Pro window when running tests

' Minimize the QuickTest Pro window
Public Function MinimizeQTPWindow ()
Set qtApp = getObject("","QuickTest.Application")
qtApp.WindowState = "Minimized"
Set qtApp = Nothing
End Function

Logic Studio Pro 8

Well I finally broke down and decide to buy Logic Studio Pro 8. It has a done of features that will take me a bit to utilize. I can now do some quality recordings

My current music editing system is:
Hardware:
20 " Intel based IMac - 3Gig mem, 2.0 GHz Dual Core
140 gig usb external drive
60 gig usb external drive
M-Audio audio interface
Behringer Mixer PreAmp
Software:
Logic Studio Pro 8
Garageband
Audacity

Music Site: myspace.com/musicofbericlak

I found Audacity and excellent tool for audio editing and capture samples.
Hopefully soon I can gave some demos for all to hear

Wednesday, March 18, 2009

March 18 2009

Creating New Installer for PAMIE 3.0. There will also be some Video tutorials on http://showmedo.com/. ShowMeDo is a great site for llearning new technology!!

Tuesday, March 3, 2009

PAMIE 3.0 almost complete! Runs with Python v3.0

Doing the final testing of PAMIE 3.0 this week. PAMIE is a python app that will allow you to Automate Internet Explorer. It is not 100% but it will allow you get most things automated for testing and development.

This is a little bit of a rewrite in Python 3.0 of the original cPAMIE.py file.
This allowing you automate Internet Explorer with Python 3.0!!

Cheers
Rob

Tuesday, February 3, 2009

Back to Work

Well it's back to work this week and there is ton's to do! I do miss Florida it was a nice vacation place for my wife and I. Today it look's like snow 1-3 inches.