Skip to content

Instantly share code, notes, and snippets.

View GLMeece's full-sized avatar

Greg Meece GLMeece

View GitHub Profile
@GLMeece
GLMeece / Windows_RF_Setup.md
Last active November 16, 2022 18:09
Windows Selenium Testing Setup for Robot Framework Use

Windows Users

Windows Bit-version Assumption

  • Execution is on a 64-bit version of Windows. To maintain continuity, we will be keeping almost everything "bit-aligned" so that executables and libraries will all be 64-bit.
  • The one possible exception to this is for Internet Explorer's Selenium Driver. See why that is below.

Configure Environment

  1. Download the appropriate browser drivers:
@GLMeece
GLMeece / find_dup_ids.js
Created January 12, 2017 16:58
Find Duplicate IDs on a Web Page
javascript:(function () {
var ids = {};
var found = false;
$('[id]').each(function() {
if (this.id && ids[this.id]) {
found = true;
console.warn('Duplicate ID #'+this.id);
}
ids[this.id] = 1;
});
@GLMeece
GLMeece / latency_numbers.md
Last active March 1, 2024 10:02
Latency Numbers Every Programmer Should Know - MarkDown Fork

Latency Comparison Numbers

Note: "Forked" from Latency Numbers Every Programmer Should Know

Event Nanoseconds Microseconds Milliseconds Comparison
L1 cache reference 0.5 - - -
Branch mispredict 5.0 - - -
L2 cache reference 7.0 - - 14x L1 cache
Mutex lock/unlock 25.0 - - -
@GLMeece
GLMeece / robot_framework_doc_css_tweaks.md
Last active March 23, 2017 03:53
CSS Tweaks for Robot Framework's documentation tools (the testing reports, LibDoc and TestDoc)

CSS Tweak

If you wish to tweak the CSS in the reports, you'll probably want to modify the Python Lib directory's robot/htmldata/rebot/common.css file (for Linux, this is usually located in /usr/local/lib/python2.7/dist-packages; in Windows it's usually C:\Python27\Lib\site-packages). I prefer the Open Sans font, so I add the following at the top of this file:

@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic);

Then, I replace 'Helvetica' with 'Open Sans' in the body's font-family declaration.

@GLMeece
GLMeece / runtime_os_info.py
Last active August 8, 2023 06:09
Get OS info at runtime
#!/usr/bin/env python
import os
import platform
"""
Utility functions for determining Operating System info at runtime.
- *Module*: runtime_os_info
- *Platform*: Unix, Mac, Windows
@GLMeece
GLMeece / how_to_execute_robot_framework_tests.md
Last active October 3, 2022 10:00
How to Run Robot Framework Tests

About

This is a quick "how to run" if you already have everything Robot Framework-related installed. This Gist might be especially handy for those you either just starting out, or if you've inherited a code-base from someone else.

The following assumes you have a terminal (CMD or PowerShell on Windows, Terminal on Mac or Linux) and aren't afraid to use it.

Testing ALL THE THINGS

Test All the Things

  1. cd into the root directory of the Robot Framework files and test cases; we'll assume all test cases are somewhere within a directory named test_cases.
@GLMeece
GLMeece / open_browser_examples.robot
Last active September 27, 2019 08:55
Open Browser Examples
# Starting with a generic "Open Browser to Page" keyword, following that are examples for:
# Google Chrome
# PhantomJS
#
# Assumed global or suite variables:
# ${browser} - the browser you want to use in testing
# ${delay} - the "speed" that Selenium verbs execute at
# ${user_agent} - User Agent string like: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
#
# Note: The documentation is written with the libdoc utility in mind. See:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Determine whether integer is a prime or not.
- *Module*: is_prime
- *Platform*: Unix, Windows
- *Author*: [mailto:glmeece@gmail.com?subject=About is_prime.py|Greg Meece]
"""
@GLMeece
GLMeece / meta-tags.md
Last active December 24, 2020 04:37 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>