Skip to content

Instantly share code, notes, and snippets.

Avatar

Fabio José Bohnenberger fabiojb

  • Brazil
View GitHub Profile
@fabiojb
fabiojb / ChromeModHeaders.java
Created Sep 15, 2017
Chrome Driver with ModHeaders extension in Java
View ChromeModHeaders.java
String userHome = System.getProperty("user.home");
options.addExtensions(new File(userHome + "\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\idgpnmonknjnojddfkpgkljpfnnfcklj\\2.1.2_0.crx"));
// Enable LocalStorage
driver.navigate().to("chrome-extension://idgpnmonknjnojddfkpgkljpfnnfcklj/icon.png");
((JavascriptExecutor)driver).executeScript(
"localStorage.setItem('profiles', JSON.stringify([{" +
" title: 'Selenium', hideComment: true, appendMode: ''," +
" headers: [" +
@fabiojb
fabiojb / Identifiable.java
Last active Jul 11, 2016
JSF Generic converter for Entities, Enums, etc.
View Identifiable.java
package org.teste.model;
public interface Identifiable<T> {
public T getId();
}