简体   繁体   中英

JQuery load page on browser and execute Jquery - No Selenium

We have tried using selenium for testing, but it has numerous setbacks, delays and sudden crashes. Jquery sounds a good alternative, but the challenge is how to jquerify every page load on the browser.

Brandon Martinez here has an example of how to add jquery to the console of chrome to jquerify a page:

var element1 = document.createElement("script");
element1.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js";
element1.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(element1);

we want that code to automatically be available in every browser page without the need to manually click a bookmark link on every page.

If we get around that then we can use C# code to:

Process.Start("chrome", @"target site");

and since jquery is already available for every page it will do the population and submit we want.

How can I automatically include jquery for every page that gets loaded on the browser? Is it possible to do that via a chrome plugin; jquery or C# code!? Is it at all possible?

I've decided to use Fiddler to modify response body before being displayed on the browser. Now I can jquerify all pages comes to the browser. Look at this link for a detailed example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM