Skip to content

Instantly share code, notes, and snippets.

View enepomnyaschih's full-sized avatar

Egor Nepomnyaschih enepomnyaschih

View GitHub Profile
@tomtheun
tomtheun / JQuerySelector.java
Created November 26, 2012 10:16
Full implementation of a jQuery based Selenium CSS selector (in Java)
package nl.avisi.langur.testing;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.RemoteWebElement;
import java.util.List;
public class JQuerySelector extends By {
private final String jQuerySelector;
@kostiklv
kostiklv / remember_password.html
Created May 12, 2011 16:53
How to make browser's remember password work with dynamic/AJAX login form
<html>
<!--
This is an example of how to make browsers
offer to remember password and later fill in those passwords
for dynamic login forms.
To make the browser offer to remember passwords the form should be actually submitted.
Since we are handling login with AJAX we don't want the form to submit, so we are still submitting it
into a dummmy iframe with dummy URL.
It's good idea to actually create empty dummy.html file, otherwise you'll flood you error.log with 404s
# selenium-webclient does not clean up cookies unless your currently on that page.
module CookieRemover
def self.delete_all(path)
Capybara.current_session.driver.visit(path)
Capybara.reset_sessions!
end
end
After("@external-site") do
CookieRemover.delete_all("http://www.external-site.com")