/**
 * The MIT License
 * Copyright © 2017 WebFolder OÜ
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package io.webfolder.cdp.sample;

import static java.util.Arrays.asList;

import java.util.List;

import io.webfolder.cdp.Launcher;
import io.webfolder.cdp.session.Session;
import io.webfolder.cdp.session.SessionFactory;
import io.webfolder.cdp.type.network.Cookie;

public class SendKeys {

    public static void main(String[] args) {

        Launcher launcher = new Launcher();
        
        try (SessionFactory factory = launcher.launch();
                            Session session = factory.create()) {
            session.getCommand().getNetwork().enable();
            List<Cookie> cookies = session.getCommand().getNetwork().getCookies(asList("https://demo.webfolder.io"));
            for (Cookie cookie : cookies) {
                session.getCommand().getNetwork().deleteCookie(cookie.getName(), "https://demo.webfolder.io");
            }
            session.navigate("https://demo.webfolder.io");
            session.waitDocumentReady();
            session.enableNetworkLog();
            session.focus("#txt-password");
            session.sendEnter();
            session.waitDocumentReady();
            session.wait(1000);
            session.focus("#txt-search");
            session.sendKeys("snoopy");
            session.wait(500);
            session.sendDownArrow();
            session.sendEnter();
            session.sendEsc();
            session.wait(500);
            session.click("a[data-image]");
            session.wait(2000);
            session.click("#btn-logout");
            session.wait(1000);
        }

    }
}

@@ -1166,72 +1166,8 @@
 e;%0A%0A
-import static java.util.Arrays.asList;%0A%0Aimport java.util.List;%0A%0A
 impo
@@ -1288,53 +1288,8 @@
 ory;
-%0Aimport io.webfolder.cdp.type.network.Cookie;
 %0A%0Apu
@@ -1605,962 +1605,194 @@
     
-List%3CCookie%3E cookies = session.getCommand().getNetwork().getCookies(asList(%22https://demo.webfolder.io%22));%0A            for (Cookie cookie : cookies) %7B%0A                session.getCommand().getNetwork().deleteCookie(cookie.getName(), %22https://demo.webfolder.io%22);%0A            %7D%0A            session.navigate(%22https://demo.webfolder.io%22);%0A            session.waitDocumentReady();%0A            session.enableNetworkLog();%0A            session.focus(%22#txt-password%22);%0A            session.sendEnter();%0A            session.waitDocumentReady();%0A            session.wait(1000);%0A            session.focus(%22#txt-search%22);%0A            session.sendKeys(%22snoopy%22);%0A            session.wait(500);%0A            session.sendDownArrow();%0A            session.sendEnter();%0A            session.sendEsc();%0A            session.wait(500);%0A            session.click(%22a%5Bdata-image%5D%22);%0A            session.wait(2000);%0A            session.click(%22#btn-logout%22);%0A            session.wait(1
+session.navigate(%22https://google.com%22);%0A            session.waitDocumentReady();%0A            session.sendKeys(%22webfolder.io%22);%0A            session.sendEnter();%0A            session.wait(5
 000)

Update broken SendKeys sample