Sha256: 5a7fbb432fb6502ad1cb5293bd858ae8c0760c967b0f150628e53ef79f96302e

Contents?: true

Size: 1.04 KB

Versions: 14

Compression:

Stored size: 1.04 KB

Contents

package sh.calaba.instrumentationbackend.actions.webview;


import sh.calaba.instrumentationbackend.InstrumentationBackend;
import sh.calaba.instrumentationbackend.Result;
import sh.calaba.instrumentationbackend.actions.Action;
import android.webkit.WebView;

public class DumpBodyHtml implements Action {

    @Override
    public Result execute(String... args) {
    	                         
    	final Result result = Result.successResult();
    	for (CalabashChromeClient ccc : CalabashChromeClient.findAndPrepareWebViews()) {
    		WebView webView = ccc.getWebView();
            webView.loadUrl("javascript:(function() {" +
                    "prompt('calabash:' + document.body.innerHTML);" +
                    "})()");
            String r = ccc.getResult();
            System.out.println("Html:");
            System.out.println("" + r);
            result.addBonusInformation(r);

            return result;

        }
        return new Result(false, "No WebView found");
    }
    public String key() {
        return "dump_body_html";
    }
}

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
calabash-android-0.4.0.pre6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.4.0.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.4.0.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.4.0.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
testautoa-0.4.0 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.4.0.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.4.0.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.3.8 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.3.7 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.3.6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.3.5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.3.4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.3.3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
calabash-android-0.3.3.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java