working on it ...

Filters

Explore Public Snippets

Sort by

Found 16 snippets matching: "web automation"

    public by lbottaro  11094  5  10  4

    Dalekjs - Simple automated web test

    This snippet is a simple test for web page using Dalekjs testing tool. Here I import functions from a 'functions' file (placed in the same dir of this file, called functions.js). The test will execute three tests, 'Snip2code footer', 'LogOut' and 'Sign Up'. More info about dalekjs tool here Site: dalekjs.com
    //var S2CSettings = require('s2c_settings');
    var S2Cfns = require('./s2c_functions');
    var domain = "http://www.snip2code.com/"
    var appName = "Snip2Code"
    
    module.exports = {
    'Snip2code footer': function (test) {
      test
    	.open(domain)
    	.assert.url(domain, 'URL is as expected')
        .assert.title().is('Snip2Code', 'It has title')
    	.assert.exists('a[href="/Static/ToS"]', 'ToS exists')
    	.assert.exists('a[href="/Static/Privacy"]', 'Privacy exists')
    	.assert.exists('a[href="/Static/AboutUs"]', 'AboutUs exists')
    	.assert.exists('a[href="mailto:info@snip2code.com"]', 'Mailto exists')
    	.assert.exists('a[href="/Static/Downloads"]', 'Downloads exists')
    	.assert.exists('a[href="http://blog.snip2code.com"]', 'Blog exists')
    	.assert.exists('a[href="/Static/Docs"]', 'API exists')
        .done();
    },
    'Logout': S2Cfns.S2CLogout.bind(S2Cfns, domain),
    'Sign Up': function (test) {
      test
    	.open(domain)
    	.click('#signupBigBt')
    	.assert.title().is('Snip2Code - Sign Up', 'Sign Up is loaded')
    	.assert.url().to.contain(domain + 'Access/Signup', 'URL is as expected')
    	.type('#EMail', 'email@test.com')
    	.type('#Username', 'Pinkman')
    	.type('#Password', 'Walt')
    	.wait(5000)
        .done();
    }
    };  

    public by lbottaro  3624  1  8  3

    Dalekjs - Define a simple functions file

    This file contains a sample of utility functions you can import in your web automation test file, using dalekjs testing tool. You can specify the argument to pass to the method: here the 'domain' argument is used into the method. More info about dalekjs tool here Site: dalekjs.com
    module.exports = {
    S2CLogout: function (domain, test) {
      console.log('Domain is:', domain);
      test
        .open(domain+'/Access/Logout')
        .done();
    }
    };

    external by simpleprogrammer-shared  68  0  1  0

    Parallel Testing With Selenium Webdriver - Automation on Steroids 2

    Parallel Testing With Selenium Webdriver - Automation on Steroids 2: parallel-testing-with-selenium-webdriver-2
    using NUnit.Framework;
    using OpenQA.Selenium.Firefox;
    
    namespace ParallelLocal
    {
        [TestFixture]
        [Parallelizable]
        public class ParallelLocal
        {
            [Test]
            public void Test1()
            {
                var driver = new FirefoxDriver();
                driver.Navigate().GoToUrl("http://www.qtptutorial.net/automation-practice");
                driver.Manage().Window.Maximize();
                driver.FindElementById("idExample").Click();
                var elementCheck = driver.FindElementByXPath("//p[contains(text(),'Button success')]").Displayed;
                Assert.IsTrue(elementCheck, "Element was not present");
            }
        }
    
        [TestFixture]
        [Parallelizable]
        public class ParallelLocal2
        {
            [Test]
            public void Test2()
            {
                var driver = new FirefoxDriver();
                driver.Navigate().GoToUrl("http://www.qtptutorial.net/automation-practice");
                driver.Manage().Window.Maximize();
                driver.FindElementByClassName("buttonClassExample").Click();
                var elementCheck = driver.FindElementByXPath("//p[contains(text(),'Button success')]").Displayed;
                Assert.IsFalse(elementCheck, "Element was not present");
            }
        }
    }
    
    

    external by gazmartina  2096  40  3  0

    A simple example of web automation using Awesomium.

    A simple example of web automation using Awesomium.: AutomationSample.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using AwesomiumSharp;
    using System.Threading;
    
    namespace Automation
    {
        class AutomationSample
        {
            WebView webView;
            bool running = true;
            public bool finishedLoading = false;
            
            public AutomationSample()
            {
                // Setup WebCore
                WebCore.Config conf = new WebCore.Config();
                WebCore.Initialize(conf);
                
                // Setup WebView
                webView = WebCore.CreateWebview(1024, 768);
                
                // Setup Callbacks
                webView.OnFinishLoading += onFinishLoading;
                webView.OnBeginLoading += onBeginLoading;
                
                Console.WriteLine("Loading Form...");
                webView.LoadURL("http://form.jotform.com/form/11023750372");
            }
            
            public void update()
            {
                while(running == true)
                {
                    WebCore.Update();
                    if(finishedLoading == true)
                    {
                        runCommands();
                    }
                    Console.WriteLine("Waiting...");
                    Thread.Sleep(4000);  // Wait 4 seconds between each command
                }
            }
            
            static int commandNumber = 1;
            public void runCommands()
            {
                switch(commandNumber)
                {
                    case 1:
                    {
                        Console.WriteLine("Typing Username...");
                        webView.ExecuteJavascript("document.getElementById('input_3').value='Username'");
                        break;
                    }
                    
                    case 2:
                    {
                        Console.WriteLine("Typing Password...");
                        webView.ExecuteJavascript("document.getElementById('input_4').value='Password'");
                        break;
                    }
                    
                    case 3:
                    {
                        Console.WriteLine("Typing First Name...");
                        click(410,150);
                        typeKeys("John");
                        break;
                    }
                    
                    case 4:
                    {
                        Console.WriteLine("Typing Last Name...");
                        click(410,197);
                        typeKeys("Doe");
                        break;
                    }
                    
                    case 5:
                    {
                        Console.WriteLine("Selecting Gender as Male...");
                        webView.ExecuteJavascript("document.getElementById('input_7_0').checked=true");
                        break;
                    }
                    
                    case 6:
                    {
                        Console.WriteLine("Selecting 'Search Engine' in combo box...");
                        webView.ExecuteJavascript("document.getElementById('input_8').value='Search Engine'");
                        break;
                    }
                    
                    default:
                    {
                        webView.Render().SaveToPNG("result.png", true);
                        System.Diagnostics.Process.Start("result.png");
                        Console.WriteLine("Done running all commands, shutting down webcore...");
                        WebCore.Shutdown();
                        running = false;
                        break;
                    }
                }
                commandNumber++;
            }
            
            public void click(int x, int y)
            {
                webView.InjectMouseMove(x,y);
                webView.InjectMouseDown(MouseButton.Left);
                webView.InjectMouseMove(x,y);
                webView.InjectMouseUp(MouseButton.Left);
            }
            
            public void typeKeys(string key)
            {
                for(int i=0; i < key.Length; i++){
                    
                    WebKeyboardEvent keyEvent = new WebKeyboardEvent();
                    
                    keyEvent.type = WebKeyType.KeyDown;
                    keyEvent.virtualKeyCode = key[i];
                    webView.InjectKeyboardEvent(keyEvent);
                    
                    keyEvent.type = WebKeyType.Char;
                    keyEvent.text =  new ushort[] { key[i], 0, 0, 0 };
                    webView.InjectKeyboardEvent(keyEvent);
                    
                    keyEvent.type = WebKeyType.KeyUp;
                    keyEvent.virtualKeyCode = key[i];
                    webView.InjectKeyboardEvent(keyEvent);
                }
            }
            
            public void onFinishLoading(object sender, WebView.FinishLoadingEventArgs e)
            {
                finishedLoading = true;
            }
            
            public void onBeginLoading(object sender, WebView.BeginLoadingEventArgs e)
            {
                finishedLoading = false;
            }
            
            public static void Main(string[] args)
            {
                AutomationSample main = new AutomationSample();
                main.update();
            }
            
        }
        
    }
     
    
    

    external by Ryan M Smith  45  0  1  0

    Python Tornado Web Class for Async Zip/XML/SQL Manipulation and Browser Automation

    Python Tornado Web Class for Async Zip/XML/SQL Manipulation and Browser Automation: python-tornado-async-threading-zip-splinter.py
    import os
    import re
    import json
    import ryan
    import time
    import redis
    import shutil
    import zipfile
    import datetime
    import threading
    import tornado.web
    import tornado.ioloop
    from splinter import Browser
    
    """ Setup the server and handlers and everything here... """
    
    class GenerateReportHandler(BaseHandler):
    	@tornado.web.asynchronous
    	def post(self):
    		try: 
    			currentUser = json.loads(self.get_current_user())
    			payload = json.loads(self.request.body)
    			whereColumn = payload['whereColumn']
    			whereValues = payload['whereValues']
    			fileName = payload['fileName']
    		except Exception as e: 
    			l.log('POST GENERATEREPORT: FAILURE: BAD_PAYLOAD')
    			self.write(json.dumps(FailureMessages['BAD_PAYLOAD']))
    			self.finish()
    			return
    
    		self.guid = ryan.randomString()
    
    		l.log("Editing Template")
    		editTemplate(self.guid, fileName, whereColumn, whereValues.split(','))
    
    		self.r.set('report_%s' %(self.guid), 'false')
    		l.log("Uploading Report")
    		t = threading.Thread(target=uploadReport, args=(self.guid, self.r, ))
    		t.start()
    		
    		self.count = 0
    		tornado.ioloop.IOLoop.instance().call_later(0.01, self.completeReportHandler)
    	
    	def completeReportHandler(self):
    		v = self.r.get('report_%s' %(self.guid))
    		self.count += 1
    
    		if self.count == 60:
    			self.write(json.dumps(FAILURE_MESSAGES['INTERNAL_ERROR']))
    			self.finish()
    			self.r.delete('report_%s' %(self.guid))
    			return
    		
    		if v == 'false':
    			tornado.ioloop.IOLoop.instance().call_later(0.5, self.completeReportHandler)
    			return
    		
    		l.log("Returning Payload")
    		payload = {'success':True, 'data':{'reportName': self.guid}, 'error':''}
    
    		self.write(json.dumps(payload))
    		self.finish()
    		self.r.delete('report_%s' %(self.guid))
    
    
    def editTemplate(guid, fileName, whereColumn, whereValues):
    	EXTRACT_BASE = './extract'
    	EXTRACT_DIR = '%s/%s' %(EXTRACT_BASE, guid)
    	ZIP_FILES = [EXTRACT_DIR + '/' + v for v in ['[Content_Types].xml', 'definition.xml']]
    	TEMPLATE_PATH = './upload/%s' %(fileName)
    	ZIP_PATH  = './reports/%s.trdp' %(guid)
    
    	try: os.mkdir(EXTRACT_BASE)
    	except: pass
    	try: os.mkdir(EXTRACT_DIR)
    	except: pass
    
    	zf = zipfile.ZipFile(TEMPLATE_PATH)
    	zf.extractall(EXTRACT_DIR)
    	zf.close()
    
    	with open('%s/definition.xml' %(EXTRACT_DIR), 'rb') as f:
    		xmlString = f.read()
    
    	m = re.search(r'SelectCommand="(.*?)"', xmlString)
    	sql = m.group(1) if m else False
    	
    	if not sql:
    	  print 'Error!'
    	  return
    
    	sql = "%s WHERE %s in (%s)" %(sql, whereColumn, ','.join(whereValues))
    
    	print sql
    
    	xmlAttribute = 'SelectCommand="%s"' %(sql)
    	newXML = re.sub(r'SelectCommand="(.*?)"', xmlAttribute, xmlString)
    
    	with open('%s/definition.xml' %(EXTRACT_DIR), 'wb') as f:
    		f.write(newXML)
    
    	zf = zipfile.ZipFile(ZIP_PATH, 'w', zipfile.ZIP_DEFLATED)
    	for file in ZIP_FILES:
    		zf.write(file, file.split('/')[-1])
    	zf.close()
    
    	shutil.rmtree('%s/%s' %(EXTRACT_BASE, guid))
    
    def uploadReport(guid, r):
    	# DRIVER = 'chrome'
    	# DRIVER = 'firefox'
    	DRIVER = 'phantomjs'
    	try:
    		t0 = time.time()
    		b = Browser(DRIVER)
    		l.log('Browser Open')
    
    		url = 'http://www.urlhere.com/path/here'
    		b.visit(url)
    		b.fill('Username', 'USERNAME')
    		b.fill('Password', 'PASSWORD')
    		button = b.find_by_value('Log in').click()
    		if not b.is_text_present('Reports'):
    			print "FAIL1"
    			return
    
    		button = b.find_by_id('uploadReportButton').click() 
    		if not b.is_text_present('Upload Report'):
    			print "FAIL2"
    			return
    
    		b.fill('reportName', guid)
    
    		if DRIVER == 'firefox':
    			b.find_by_xpath('//*[@id="reportUploadForm"]/div[2]/div[2]/span').mouse_over()
    			b.find_by_xpath('//*[@id="reportUploadForm"]/div[2]/div[2]/span').click()
    			time.sleep(.5)
    			b.find_by_xpath('//*[@id="reportCategory_listbox"]/li[2]').click()
    		if DRIVER == 'chrome' or DRIVER == 'phantomjs':
    			b.find_by_xpath('//*[@id="reportUploadForm"]/div[2]/div[2]/span').mouse_over()
    			b.find_by_xpath('//*[@id="reportUploadForm"]/div[2]/div[2]/span').click()
    			for i in range(10):
    				try: 
    					b.find_by_xpath('//*[@id="reportCategory_listbox"]/li[2]').click()
    					break
    				except: pass
    		
    		b.attach_file('reportFile', '%s/reports/%s.trdp'%(CWD, guid))
    		# b.driver.save_screenshot('your_screenshot.png')
    		b.find_by_id('reportUploadSaveButton').click()
    	except Exception as e:
    		eln = ryan.getErrorLineNumber()
    		print "ERROR: LN: %s: MSG: %s" %(eln, e.message)
    		print e
    	finally:
    		r.set('report_%s' %(guid), 'true')
    		b.quit()
    		l.log("Total Time: %s" %(time.time()-t0))
    
    

    external by simpleprogrammer-shared  34  0  1  0

    Parallel Testing With Selenium Webdriver - Automation on Steroids 4

    Parallel Testing With Selenium Webdriver - Automation on Steroids 4: parallel-testing-with-selenium-webdriver-4
    using System;
    using NUnit.Framework;
    using OpenQA.Selenium;
    using OpenQA.Selenium.Remote;
    
    namespace SauceLabsParallelTests
    {
        [TestFixture("chrome", "39", "Windows 7", "", "")]
        [Parallelizable]
        public class SauceNUnitTest2
        {
            private IWebDriver _driver;
            private string _browser;
            private string _version;
            private string _os;
            private string _deviceName;
            private string _deviceOrientation;
    
            public SauceNUnitTest2(string browser, string version, string os, string deviceName, string deviceOrientation)
            {
                _browser = browser;
                _version = version;
                _os = os;
                _deviceName = deviceName;
                _deviceOrientation = deviceOrientation;
            }
    
            [SetUp]
            public void Init()
            {
                DesiredCapabilities caps = new DesiredCapabilities();
                caps.SetCapability(CapabilityType.BrowserName, _browser);
                caps.SetCapability(CapabilityType.Version, _version);
                caps.SetCapability(CapabilityType.Platform, _os);
                caps.SetCapability("deviceName", _deviceName);
                caps.SetCapability("deviceOrientation", _deviceOrientation);
                caps.SetCapability("username", Environment.GetEnvironmentVariable("SAUCELABS_USER", EnvironmentVariableTarget.User));
                caps.SetCapability("accessKey", Environment.GetEnvironmentVariable("SAUCELABS_KEY", EnvironmentVariableTarget.User));
                caps.SetCapability("name", TestContext.CurrentContext.Test.Name);
    
                _driver = new RemoteWebDriver(new Uri("http://ondemand.saucelabs.com:80/wd/hub"), caps,
                    TimeSpan.FromSeconds(600));
    
            }
    
            [Test]
            public void UltimateQaTest1()
            {
                _driver.Navigate().GoToUrl("http://courses.ultimateqa.com");
                Assert.IsTrue(true);
            }
    
            [TearDown]
            public void CleanUp()
            {
                bool passed = true;
                try
                {
                    // Logs the result to Sauce Labs
                    ((IJavaScriptExecutor)_driver).ExecuteScript("sauce:job-result=" + (passed ? "passed" : "failed"));
                }
                finally
                {
                    // Terminates the remote webdriver session
                    _driver.Quit();
                }
            }
        }
    }
    
    

    external by simpleprogrammer-shared  22  0  1  0

    Parallel Testing With Selenium Webdriver - Automation on Steroids

    Parallel Testing With Selenium Webdriver - Automation on Steroids : parallel-testing-with-selenium-webdriver-1
    using NUnit.Framework;
    using OpenQA.Selenium.Firefox;
    
    namespace ParallelLocal
    {
        [TestFixture]
        public class ParallelLocal
        {
            [Test]
            public void Test1()
            {
                var driver = new FirefoxDriver();
                driver.Navigate().GoToUrl("http://www.qtptutorial.net/automation-practice");
                driver.Manage().Window.Maximize();
                driver.FindElementById("idExample").Click();
                var elementCheck = driver.FindElementByXPath("//p[contains(text(),'Button success')]").Displayed;
                Assert.IsTrue(elementCheck, "Element was not present");
            }
        }
    }
    
    

    external by simpleprogrammer-shared  22  0  1  0

    Parallel Testing With Selenium Webdriver - Automation on Steroids 3

    Parallel Testing With Selenium Webdriver - Automation on Steroids 3: parallel-testing-with-selenium-webdriver-3
    using System;
    using NUnit.Framework;
    using OpenQA.Selenium;
    using OpenQA.Selenium.Remote;
    
    namespace ParallelTestingBrowserStack
    {
        [TestFixture]
        [Parallelizable]
        public class BrowserstackTest1
        {
            private IWebDriver _driver;
    
            [SetUp]
            public void Init()
            {
                DesiredCapabilities capability = DesiredCapabilities.Firefox();
                capability.SetCapability("browserstack.user", Environment.GetEnvironmentVariable("BROWSERSTACK_USER", EnvironmentVariableTarget.User));
                capability.SetCapability("browserstack.key", Environment.GetEnvironmentVariable("BROWSERSTACK_KEY", EnvironmentVariableTarget.User));
                capability.SetCapability("browser", "Safari");
                capability.SetCapability("browser_version", "5.1");
                capability.SetCapability("os", "OS X");
                capability.SetCapability("os_version", "Snow Leopard");
                capability.SetCapability("resolution", "1024x768");
    
                _driver = new RemoteWebDriver(
                    new Uri("http://hub.browserstack.com/wd/hub/"), capability
                    );
            }
    
            [Test]
            public void BrowserStackTest01()
            {
                _driver.Navigate().GoToUrl("http://www.qtptutorial.net/automation-practice");
                _driver.Manage().Window.Maximize();
                _driver.FindElement(By.Id("idExample")).Click();
                var elementCheck = _driver.FindElement(By.XPath("//p[contains(text(),'Button success')]")).Displayed;
                Assert.IsTrue(elementCheck, "Element was not present");
            }
    
            [TearDown]
            public void Cleanup()
            {
                _driver.Quit();
            }
        }
    }
    
    

    external by hmcclungiii  1572  2  4  0

    C# Webbrowser Wrapper Control, used to be able to wait until a page completely loads prior to taking action on it. For web automation projects.

    C# Webbrowser Wrapper Control, used to be able to wait until a page completely loads prior to taking action on it. For web automation projects.: browserwrapper.cs
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Drawing;
    using System.Windows.Forms;
    
    public partial class browserwrapper : System.Windows.Forms.WebBrowser
    {
    
    	/// <summary>
    	/// Designer variable used to keep track of non-visual components.
    	/// </summary>
    	private System.ComponentModel.IContainer components;
    
    	/// <summary>
    	/// Disposes resources used by the control.
    	/// </summary>
    	/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    	protected override void Dispose(bool disposing)
    	{
    		if (disposing) {
    			if (components != null) {
    				components.Dispose();
    			}
    		}
    		base.Dispose(disposing);
    	}
    
    	/// <summary>
    	/// This method is required for Windows Forms designer support.
    	/// Do not change the method contents inside the source code editor. The Forms designer might
    	/// not be able to load this method if it was changed manually.
    	/// </summary>
    	private void InitializeComponent()
    	{
    		//
    		//browserwrapper
    		//
    		//Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
    		this.Name = "browserwrapper";
    	}
    
    	/// <summary>
    	/// This event is raised when the current document is entirely complete, 
    	/// and no more navigation is expected to take place for it to load.
    	/// </summary>
    	/// <author>hmcclungiii</author>
    	/// <date>2/21/2014</date>
    	public event AbsolutelyCompleteEventHandler AbsolutelyComplete;
    	public delegate void AbsolutelyCompleteEventHandler(object sender, EventArgs e);
    
    	private int _onNavigatingCount = 0;
    	private int _onNavigatedCount = 0;
    	private int _onDocumentCompleteCount = 0;
    
    	/// <summary>
    	/// This method is used to clear the counters.  Should not be used
    	/// externally, but I left it open for testing, and just in case
    	/// scenarios
    	/// </summary>
    	/// <author>hmcclungiii</author>
    	/// <date>2/21/2014</date>
    	public void ClearCounters()
    	{
    		_onNavigatingCount = 0;
    		_onNavigatedCount = 0;
    		_onDocumentCompleteCount = 0;
    	}
    
    
    	/// <summary>
    	/// This property returns true when all the counters have become equal
    	/// signifying that the navigation has completely completed
    	/// </summary>
    	/// <author>hmcclungiii</author>
    	/// <date>2/21/2014</date>
    	public bool Busy {
    		get {
    			//sometimes the first navigating event isn't fired so we just have to make sure the navigating count is 
    			//more than the navigated, navigated should never be more than navigating
    			bool bBusy = !(_onNavigatingCount <= _onNavigatedCount);
    			//if our navigating counts check out, we should always have a documentcompleted count
    			//for each navigated event that is fired
    			if (!bBusy)
    			{
    				bBusy = (_onNavigatedCount > _onDocumentCompleteCount);
    			}
    			else
    			{
    				bBusy = !(_onNavigatedCount == _onDocumentCompleteCount);
    				if (!bBusy) bBusy=!(_onNavigatedCount>0);
    			}
    			return bBusy;
    		}
    	}
    
    	/// <summary>
    	/// This method is used to wait until the page has completely loaded.  Use
    	/// after calling a submit, or click, or similar method to not execute further
    	/// code in the calling class until it has completed.  Also helps to reduce
    	/// processor load
    	/// </summary>
    	/// <author>hmcclungiii</author>
    	/// <date>2/21/2014</date>
    	public void WaitUntilComplete()
    	{
    		//first we wait to make sure it starts
    		while (!Busy) {
    			Application.DoEvents();
    			//we should sleep for a moment to let the processor have a timeslice
    			//for something else - in other words, don't hog the resources
    			System.Threading.Thread.Sleep(1);
    		}
    		//now we wait until it is done
    		while (Busy) {
    			Application.DoEvents();
    			//we should sleep for a moment to let the processor have a timeslice
    			//for something else - in other words, don't hog the resources
    			System.Threading.Thread.Sleep(1);
    		}
    	}
    
    	public browserwrapper()
    	{
    		this.InitializeComponent();
    	}
    
    //we have to catch the following three event callers to keep a count
    //of them so that we will be able to determine when the navigation
    //process actually completes
    	protected override void OnNavigating(WebBrowserNavigatingEventArgs e)
    	{
    		_onNavigatingCount += 1;
    		base.OnNavigating(e);
    		if (!Busy)
    			OnAbsolutelyComplete();
    	}
    	protected override void OnNavigated(WebBrowserNavigatedEventArgs e)
    	{
    		_onNavigatedCount += 1;
    		base.OnNavigated(e);
    		if (!Busy)
    			OnAbsolutelyComplete();
    	}
    	protected override void OnDocumentCompleted(WebBrowserDocumentCompletedEventArgs e)
    	{
    		_onDocumentCompleteCount += 1;
    		base.OnDocumentCompleted(e);
    		if (!Busy)
    			OnAbsolutelyComplete();
    	}
    
    	/// <summary>
    	/// This method should be used in place of the Navigate method to navigate to
    	/// a specific URL.  The navigate method was not overridden because it might
    	/// be required in future modifications to have access to both methods.  When
    	/// calling this NavigateAndWait method, control will not be returned to the
    	/// calling class until the document has completely loaded
    	/// </summary>
    	/// <author>hmcclungiii</author>
    	/// <date>2/21/2014</date>
    	public void NavigateAndWait(string URL)
    	{
    		ClearCounters();
    		Navigate(URL);
    		WaitUntilComplete();
    	}
    
    	protected void OnAbsolutelyComplete()
    	{
    		ClearCounters();
    		if (AbsolutelyComplete != null) {
    			AbsolutelyComplete(this, new EventArgs());
    		}
    	}
    
    }
    
    
    

    external by shahaakash  361  0  3  0

    Basic Selenium WebDriver Automation Script Structure

    Basic Selenium WebDriver Automation Script Structure: BasicSelenium.java
    // Define Package Name
    package wpAdmin;
    
    // Import Selenium Libraries
    import org.openqa.selenium.By;
    import org.openqa.selenium.JavascriptExecutor;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    
    // Define Class Name
    public class BasicStructure {
    
    	public static void main(String[] args) {
    		
        //  Selenium WebDriver Commands
    
    	}
    }
    
    
    
    • Public Snippets
    • Channels Snippets