Skip to content

Instantly share code, notes, and snippets.

View emanlove's full-sized avatar

Ed Manlove emanlove

  • Rhode Island
View GitHub Profile
@emanlove
emanlove / README.rst
Last active February 24, 2024 18:00
Example of and some commentary on how to interact with Angular Material Select Component or mat-slect

What is this gist?

A question was asked within the Robot Framework community. That is "Does anyone know how to interact with ... mat-select fields in the robot?". This is a detailed response that delves into both the specific problem but also some themes around that question and my examples.

Disclaimer

I have alot to say (why these locators, what is this Angular Library and a lot of how one uses it, etc) but little time. So I expect this to be a incomplete and conssistanly in flux gist. But hopefully it is helpful.

@emanlove
emanlove / example.py
Created May 5, 2023 14:22
Adding logging to Python Selenium unit tests
import logging
import sys
root = logging.getLogger()
root.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
@emanlove
emanlove / parseChromedriverversion.bat
Created October 3, 2022 11:39
Method for parsing chromerdriver version programmatically
for /F "tokens=2" %%v in ('chromedriver --version') do (
set Version=%%v
for /F "tokens=1,2,3,4 delims=." %%a in ("%Version%") do (
set Major=%%a
set Minor=%%b
set Revision=%%c
set Tail=%%d
)
)
@emanlove
emanlove / robotframework-lsp-functionality.rst
Created April 21, 2020 17:43
Language Server Functionality

Implemented

Launch .robot files [Ed: Does this mean executing robot scripts or loading/"opening" files in an editor?] Code completion for keywords, section headers and section settings Go to definition for keywords (new in 0.0.9) Syntax highlighting [Ed: list of syntax?][Ed: is this done by the lsp or the grammer and ide?] Syntax validation [Ed: is this done by the lsp or the grammer and ide?] Code Formatting [? definition]

Other ideas

@emanlove
emanlove / Functionality-For-Robot-Framework-IDE-Editor.rst
Last active July 1, 2018 11:18
Documenting desired functionality for any Robot Framework IDE or Editor.

Functionality for Robot Framework IDE or Editor

Running list of functionality and features that make up a useful set of tools within an IDE or Editor.

Functionality I would like to see

  • RTL support
  • show formatting marks (similar to what one sees in Word or LibreOffice)
@emanlove
emanlove / BasicForm.html
Created June 15, 2018 10:03
Debug scripts to determine where the issue is when IE / Robot Framework / Selenium / Web Application translates ~O as Ö
<html>
<head></head>
<body>
<form>
<input id="editbox" type="text" />
</form>
</body>
</html>
@emanlove
emanlove / check.robot
Created April 5, 2018 23:47
Robot Framework output of test importing AngularJSLibrary
*** Settings ***
Library String
Library Collections
Library OperatingSystem
Library SeleniumLibrary
Library AngularJSLibrary
*** Test Cases ***
Simple Log
@emanlove
emanlove / waitForAngularCore.js
Created June 7, 2017 00:31
Test code that is run in browser devtools/console window proving out javascipt code for mimicing Protractor's waitForAngular function.
var callback = function () {console.log('*')};
var el = document.querySelector('[ng-app]');
var h = setInterval(function w4ng() {
console.log('.');
try {
if (window.angular && !(window.angular.version &&
window.angular.version.major > 1)) {
/* ng1 */
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
@emanlove
emanlove / SampleLibrary.py
Created January 7, 2016 11:11
Overriding methods of object within another RF Library
import types
from robot.libraries.BuiltIn import BuiltIn
class SampleLibrary(object):
_s2l = BuiltIn().get_library_instance('Selenium2Library')
def __init__(self):
# override Selenium2Library's _find_by_default method
import pdb,sys; pdb.Pdb(stdout=sys.__stdout__).set_trace()
# self._s2l._element_finder._find_by_default = types.MethodType(self._override_function, self._s2l._element_finder)
@emanlove
emanlove / testHangs.py
Created August 5, 2012 00:30
selenium call which hangs
import unittest
from selenium import webdriver
class SwitchToWindow(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
def test_switch_to_window(self):
driver = self.driver