Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions script-api/pizzascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -1416,26 +1416,26 @@ Browser.prototype.setValue = function(selector, value) {};
* Get the html inside the given element
*
* @example
* var html = b.getInnerHTML('#input1');
* var html = b.getInnerHtml('#input1');
*
* @param {String} selector the element to get the HTML from
* @return {String} the inner HTML for the given element
* @throws Throws an exception if the element can not be found
*/
Browser.prototype.getInnerHTML = function(selector) {};
Browser.prototype.getInnerHtml = function(selector) {};

/**
* Get the html for the given element or the entire frame if
* no element specified.
*
* @example
* var html = b.getInnerHTML();
* var html = b.getInnerHtml();
*
* @param {String=} selector the element to get the HTML for
* @return {String} the outer HTML for the given element
* @throws Throws an exception if the element can not be found
*/
Browser.prototype.getOuterHTML = function(selector) {};
Browser.prototype.getOuterHtml = function(selector) {};

/**
* Get the text inside the given element
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,15 +646,15 @@ public interface Browser {
* @param selector the element to get the HTML from
* @return the inner HTML for the given element
*/
String getInnerHTML(String selector);
String getInnerHtml(String selector);

/**
* Get the html for the given element
*
* @param selector the element to get the HTML for
* @return the outer HTML for the given element
*/
String getOuterHTML(String selector);
String getOuterHtml(String selector);

/**
* Get the html for the entire currently selected frame.
Expand All @@ -663,7 +663,7 @@ public interface Browser {
*
* @return the outer HTML for the current frame.
*/
String getOuterHTML();
String getOuterHtml();

/**
* Get the text inside the given element
Expand Down
5 changes: 5 additions & 0 deletions scripts/basic.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
// Open the browser and navigate to the requested URL
// NOTE: A browser instance can be opened without initially
// setting the URL, see script: sitelogin.js
b = pizza.open("www.google.com");

// Verify the following text exists on the page
b.verifyText("Google");
29 changes: 29 additions & 0 deletions scripts/dig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Script using Google's hosted DIG (DNS) utility to log
// the Authoritative nameservers of the requested domain

var b = pizza.open("https://toolbox.googleapps.com/apps/dig/");

b.waitForVisible("#domain");

var domains = ["walmart.com", "amazon.com"];

b.type("#domain",utils.randomElement(domains));

var records = ["A", "AAAA", "ANY", "CNAME", "MX", "NS", "PTR", "SOA", "SRV", "TXT"];

// b.click("xpath://input[@value=\"" + records[5] + "\"]");
b.click("input[value=\"" + records[5] + "\"]");

b.waitForVisible('#response-text');

var html = b.getInnerHTML('#response-text');

var re = /href="(.*?)"/g;

var authNameServers = [];

while(match = re.exec(html)){
authNameServers.push(match[1].split("@")[1]);
}

console.log(authNameServers);
24 changes: 24 additions & 0 deletions scripts/lookingglass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Script to lookup and log the IPv4 peered
// Autonomous System Numbers (ASN) of the domain

var b = pizza.open('http://bgp.he.net/');

var domains = ['walmart.com', 'amazon.com'];

b.type('#search_search', utils.randomElement(domains));

b.click("xpath://input[@name=\"commit\"]");

b.waitPageLoad();

b.waitForVisible('#tab_ipinfo');

b.click('#tab_ipinfo');

b.waitForElement('a:contains(AS)');

b.click('a:contains(AS)')

b.waitPageLoad();

console.log(b.getInnerText(".toppeertable"));