Hi,
I use specflow on a daily basis, with IE automation.
Some tips:
Start with the generic case and then add methods that use this generic case
to make things easier.
ex:
>>>> When I am logged in as "username" with password "password"
then I create steps for
>>>> When I am logged in as a User
>>>> When I am logged in as an Administrator
>>>> When I am logged in as a User without a shopping basket
Use one class for your steps, ie SpecflowSteps.cs
but make this partial and create classes that separate your steps into
logical groupings.
For testing on Asp.Net websites I use this
public static Regex AsAspId(this string text)
{
if (string.IsNullOrEmpty(text))
{
throw new NotImplementedException();
}
return new Regex(text + "$");
}
So I can match buttons and links by the name in the code and not the
generated name.
And here is a Link does not exist step using it.
[Given(@"I cannot see the link ""(.*)""")]
public void GivenICannotSeeTheLink(string p0)
{
Regex search = p0.AsAspId();
Link link =
WebBrowser.Current.Link(Find.ById(search).Or(Find.ByAlt(search)).Or(Find.ByName(search)).Or(Find.ByClass(search)));
Assert.IsFalse(link.Exists, "Link found {0}", p0);
}
As I said before this is only run in IE, the testing team / developers use
it to test functionality, then the testing team will test in the 4 browsers
that we support for inconsistencies.
Hth
Davy
Davy,
"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia
On Tue, Apr 29, 2014 at 10:25 AM, Dave Walker <[email protected]> wrote:
> Yeah we are. Works alright but have big issues with some browsers being
> flakey.
>
> We use it in conjunction with a selenium grid that in theory you can have
> a heap of instances running on with all variants of browsers. You can also
> integrate it with online services e.g. https://saucelabs.com/
>
> Good things to do
> * Take screenshots of the issues, IE has big issues with this
> * If you can integrate taking videos - that'd be great but apparently we
> can't do it. Lame
> * We have had three separate goes at this now - building an object model
> around our product has been the best way forward as we are future proofing
> implementation details. We have a ISearchControls implementation for
> example that can look at any one of our 2 or 3 sites and knows how to
> search. Before that it was a huge mess.
> * Integrate with build ASAP
> * Developers and testers should own the tests - our test division was
> really ansty about us changing or tests but what would happen was that the
> test team would fall behind (creating these tests are slow) so a feature
> would sit in our test queue, or would not have enough tests
> * If you use a grid make sure that you can enlist your development machine
> into the grid - use a capability filter to make sure that only your tests
> get run. But it's a good way to diagnose issues before the expense of the
> build run.
> * Have lots of machines on the grid and make them run in parallel so that
> they get done faster. Otherwise your build process will take ages.
>
>
>
>
>
>
> On 29 April 2014 15:45, Kirsten Greed <[email protected]> wrote:
>
>> Hi All
>>
>> Not sure if this is OT or not, but is anyone using Specflow?
>> I am wondering if the practice works in reality...
>>
>> www.specflow.org
>> Thanks
>> Kirsten
>>
>
>