stirno / fluentautomation Goto Github PK
View Code? Open in Web Editor NEWSimple Fluent API for UI Automation
Home Page: http://fluent.stirno.com
License: MIT License
Simple Fluent API for UI Automation
Home Page: http://fluent.stirno.com
License: MIT License
If I expect count of 2 then I get an error 'Count assertion failed. Expected there to be [2] elements matching [somevalue]].Actual count is [1].
Count seems to be zero based and shouldn't be
In the SeleniumWebDriver.Element.OnChange method (line 121) has problems with IE, including IE9:
public virtual void OnChange()
{
((IJavaScriptExecutor)_driver).ExecuteScript(string.Format("if (typeof jQuery != 'undefined') {{ jQuery(\"{0}\").click(); }}", _fieldSelector.Replace("\"", "")));
}
The answer appears to be to use click(), from this discussion: http://stackoverflow.com/questions/208471/getting-jquery-to-recognise-change-in-ie
Or if you're using jQuery 1.5 the problem is resolved but unfortunately we're using jQuery 1.3.
Once I setup Github I'll try to push a patch
An alert dialog that doesn't get handled causes the test runner to wait for user interaction, which never comes.
FluentAutomation.API.AssertException: Value assertion failed. Expected element [#login-button] to have a value of [Login] but actual value is [string.Empty].
Counts of items matching a selector..
I.Expect.Count(10).Of("selector");
IE window now maximizes and this should be user configurable
May seem obvious but is it possible to test and ensure a line of text is "not" found in the page once it has rendered?
I.Hover('some-selector') isn't working properly on Selenium. The mouse moves, however, it doesn't appear to be scoping the hover in the context of the browser window.
Assert.Fail failed. Value assertion failed. Expected element [input.email:eq(0)] to have a value of [] but actual value is [].
email = string.Empty.
Perhaps it is trying to compare a null to a string.Empty
string.Format error when class is not found on element in Selenium using Chrome. Haven't tested in other browsers/WatiN.
Since I have some problems with WebDriver when running tests in batch is it possible to update to the latest version? Thanks!
Great project - would it be possible to add a property to access your current WebDriver, i.e. FirefoxDriver. I'm not sure how it would with I, something like
I.GetDriver().FindElement(By.Name("q"))
I need this as sometimes Sizzle break with jQuery, or doesn't give us the ability to do a text search of the innerHtml.
If a row is entered on an UI, and the css selector is same for all items on the UI except for the :eq index number, I need to be able to get the index number of the customer identified by a title value.
For example, the UI consists of a sorted grid with two columns. In the first column it lists the customer in alpha order. The next column is a delete buttons which correspond to the customer that the row it is on.
Customer | Action |Index |
Dick's Bar and Grill | Delete |0 |
Don's Kwik Shop | Delete |1 |
Joe's Bait Store | Delete |2 |
The Gas Station | Delete |3 |
Now, if I add "Apple Pie Restaurant" to this, then all the indexes are going to change. If I want to click the Delete button for Joe's Bait Store, I need to be able to get the index for Joe's Bait Store, so I can click the correct Delete button.
I.Enter("Jason").Quickly.In("#name");
I.Expect.This("Jason").In("#name");
Gives error Assert.Fail failed. Value assertion failed. Expected value of Jason but actual value is .
With this code:
If I do an "I.Expect.This("add").In("some-node a:eq(0)"), it will not fail but should because "display: none"
Related to Issue #9 but limited to removing the functionality of I.Use to open the browser and instead setting the desired browser if different the default. This would open the browser on the first action and not on I.Use. Ability to change default browser in config file is separate issue
Add css selector used on an assert. Also place values in the assert in [] to separate the selector or text element used from the assert error sentance.
I.Expect.Url(Config.LoginPage);
public static string LoginPage
{
get
{
return string.Format("http://{1}/Account/LogOn?returnUrl=http%3a%2f%2f{0}.{1}%3a80", Customer, Site);
}
}
worked previously but now getting:
URL Assertion failed. Expected URL
http://domain.tld/Account/LogOn?returnUrl=http%3a%2f%2fcustomer.domain.tld%3a80 but actual URL is
http://domain.tld/Account/LogOn?returnUrl=http://customer.domain.tld:80.
because the window is now maximized, I can't visually verify the url
Should be able to add logging output to a file or to test output.
Need ability to switch document in case of iframes in page. Or have a way of having access to the driver and do it classic way ie
driver.SwitchTo().Frame(someFrame).
Maybe this can be achieved in another way already , but I couldn't find it.
Thanks for your help
Would be nice to be able to extend the ActionManager class to help encapsulate repeated test steps.
I.Expect.Text("Add").In("User.AddButton") - returns 'Value assertion failed. Expected element [input[Value='Add']] to have a value of [Add] but actual value is [string.Empty]
Error message should be input[Text='Add']
Allow for lambdas to support:
I.Expect.This(s => s.Contains("string")).In("selector");
I.Expect.Url(url => url.StartsWith("https://").In("selector");
If a selector contains multiple elements the text content of each is mashed together for an I.Expect.Value. Improve on this by allowing a list of values to compare to the content of a group of elements.
Value assertion failed. Expected element [.success-message ] to have a value of [Successfully added] but actual value is [Successfully added ].
The expected value is stored in a resource file which trims values but the actual value is not trimmed. Actual value should be trimmed.
We have a select list and a list of items can be added to it. If an item is already there it should not be added to the list. We need a way to validate that a list does not have duplicates or specify that a specific item is not duplicated.
Need the ability to sendkeys - tried to use:
System.Windows.Forms.SendKeys.SendWait("TAB");
but no luck
While looking into another reported issue, noticed that the Selenium providers Focus implementation is.. incomplete..
public virtual void Focus()
{
}
Oops.
Hello,
we've tried out the version that is under development right now (brought down the codez, compiled and used it), and we're missing the Quickly-way of entering text. That is - no events firing.
Is this by design or has it slipped away
Comparison from a select using I.Expect.This().In() on a select box compares the entire list of options not the currently selected option.
It would be great to be able to do something like this:
I.Expect.Attribute("src").Value("tick.png").In("#my_img");
or is it already available?
In firebug, this works: $(".wizard select.It:eq(0)");
When using: $(".wizard select.It:eq(0)"); this error occurs:
SelectElement value assertion failed. Expected element [.wizard select.It :eq(0)] to have a selected value of [Select...] but actual selected value is [string.Empty].
I am now able to get it to work with [.wizard select.It :eq(0) option:selected]
FluentAutomation.API.AssertException: Value assertion failed. Expected element [div.error] to have a value of [User name or password is incorrect.] but actual value is [string.Empty].
Confirmed in jquery that when running:
$("div.error")
I get 1 result:
<div class="error">User name or password is incorrect.</div>
We have a textbox for search. When you type in the textbox a list is displayed below it. This list closes when you lose focus. When trying to click on an item in the list I can see watin highlight the item that it clicked on but nothing seems to happen. This works repeating the steps manually. It seems that Fluent/Watin is causing some additional interaction from what a user would do that is causing this list to lose focus and close.
I am unable to find a "I.Close(url)" to compliment the "I.Open(url)"
Doing and I.Expect.Url right after I.Click that triggers a page load fails due to race condition. I.Expect.Url can trigger before the page has loaded and therefore compares against the previous page.
I.Use(BrowserType.InternetExplorer);
What if I want to run the same test against different browsers?
I.Use may not be necessary assuming this won't support opening multiple browser sessions during a single test then the browser can be opened automatically on the first call to I.Action
_browser can be referenced from a property and if null can open a new session
Options to set browser can be in config or I.Set.Browser(BrowserType.InternetExplorer)
If a have a css selector such as: " .node a:eq({0})", I need to be able to pass in the index and have it return the text value of that css selector
I.Drag throws NotImplementedException with the Selenium provider.
Apparently there's some authentication logic within the AutomationProvider, but it's not clear how to expose that to a test.
Is this a case where I just create my own AutomationProvider/CommandManager and or what are your intentions with that basic auth logic?
(might not be a bug)
When using the WaitUntil functionality with Selenium I kept running into issues where the automation was trying to run before the page was fully loaded.
This was causing JS errors.
My current work around look like is:
public void WaitUntil(Expression conditionAction, TimeSpan timeout)
{
this.Act(() =>
{
DateTime dateTimeTimeout = DateTime.Now.Add(timeout);
string source = this.webDriver.PageSource;
while (DateTime.Now < dateTimeTimeout)
{
System.Threading.Thread.Sleep(Settings.DefaultWaitUntilThreadSleep);
if (source.Equals(this.webDriver.PageSource))
{
break;
}
else
{
source = this.webDriver.PageSource;
}
}
bool threwException = false;
var compiledAction = conditionAction.Compile();
FluentException lastFluentException = null;
do
{
try
{
threwException = false;
compiledAction();
}
catch (FluentException ex)
{
threwException = true;
lastFluentException = ex;
}
catch (Exception ex)
{
throw new FluentException("An unexpected exception was thrown inside WaitUntil(Action). See InnerException for details.\r\n{0}", ex, source);
}
if (!threwException)
{
break;
}
System.Threading.Thread.Sleep(Settings.DefaultWaitUntilThreadSleep);
}
while (DateTime.Now < dateTimeTimeout);
// If an exception was thrown the last loop, assume we hit the timeout
if (threwException == true)
{
throw new FluentException("Conditional wait passed the timeout [{0}ms]. See InnerException for details of the last FluentException thrown.\r\n{1}", lastFluentException, timeout.TotalMilliseconds, source);
}
});
}
I.Expect.Class('.error').On('#field');
Not working properly in Selenium using Firefox or Chrome drivers. Tracking so I can tackle this later.
System.NullReferenceException: Object reference not set to an instance of an object.
at FluentAutomation.SeleniumWebDriver.AutomationProvider.HandleAlertDialog(String expectedMessage)
at FluentAutomation.API.ExpectManager.Alert(String alertMessage)
It is difficult to calculate a point from the corner of the screen which will not be consistent with screen resolution. Need the ability to specify an element in the browser to be a point of reference from which the point is calculated
Trying to get this working with Xunit + Selenium WebDriver + Resharper Test Runner
All I get back is System.InvalidOperationException: No automation provider available.
I have the relevant Nuget packages installed:
Is something not copying correctly when the test runner runs?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.