Skip to content

asifurrouf/CodedUI.jQueryExtensions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodedUI.jQueryExtensions

CodedUI.jQueryExtensions is a simple set of extension methods for the Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow class. It will allows you to select things in the page under test using jQuery selectors.

CodedUI.jQueryExtensions NuGet package

What does it give me?

#Methods

public static IEnumerable<T> JQuerySelect<T>(this BrowserWindow window, string selector)
public static bool JQueryExists(this BrowserWindow window, string selector)
public static bool JQueryWaitForExists(this BrowserWindow window, string selector)
public static bool JQueryWaitForExists(this BrowserWindow window, string selector, int timeoutMilliSeconds)
public static bool JQueryWaitForNotExists(this BrowserWindow window, string selector, int timeoutMilliSeconds)
public static string JQueryHtml(this BrowserWindow browserWindow, string selector)
public static string JQueryVal(this BrowserWindow browserWindow, string selector)
public static string JQueryText(this BrowserWindow browserWindow, string selector)

#Features CodedUI.jQueryExtensions will automatically include a jQuery script into the page if one does not already exist.

What configuration does it require?

When the CodedUI.jQueryExtensions nuget package is added to a project, a key will be added automatically to the app.config.

<add key="CodedUI.JQueryExtensions.jQuerySrc" value="//code.jquery.com/jquery-latest.min.js" />

This is the URL of the jQuery script that you would like CodedUI.jQueryExtensions to include if jQuery is not already included on that page. By default it uses the latest version of jQuery available from their CDN. You may wish to change this URL to a specific version. The version of jQuery that is loaded from the URL will be attached to window.CodedUI.jQueryExtensions.jQuery using jQuery.noConflict().

If you already have jQuery on the page then that version will be used.

Can I use it with Visual Studio 2010, 2012, 2013 ?

It will work with Visual Studio 2012 and 2013.

How do I use it?

###Selecting li's from a ul with an id

public IEnumerable<HtmlControl> GetLiElements()
{
	return Browser.JQuerySelect<HtmlControl>("#multipleElementsTest li");
}

###Waiting for an element to exist on a page

public bool WaitForDivToExist()
{
	return Browser.JQueryWaitForExists("#divExistAfter5SecondsTest");
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 82.9%
  • HTML 10.8%
  • PowerShell 6.2%
  • Batchfile 0.1%