Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Are there any open source frameworks based on Selenium WebDriver in C# that
Abstract all test and object logic away
Record actions straight into Selenium Webdriver C# code?
I am thinking of writing a framework (not sure about the recording feature), but maybe it's already been done!
•Abstract all test and object logic away -- must be done manually
Record actions straight into Selenium Webdriver C# code? -- the firefox plugin "selenium ide" can output test steps in C#. You can then use the "page object" design pattern to abstract away the object logic.
Here is the best example of using the "page object" pattern I have found. Example is C#
http://seleniumexamples.com/blog/examples/selenium2-in-net-framework/
C# frameworks for Selenium Webdriver:
https://github.com/ProtoTest/ProtoTest.Golem
https://github.com/ObjectivityBSS/Test.Automation
You can try Seleno:
http://teststack.github.com/TestStack.Seleno
It implements the Page Object pattern. It encourages a separation of concern between the logic of your page and your tests.
You can use the Selenium Firefox plugin to record actions, however in my experience it's only been useful for recording quick scripts to aid in development. The code it generates hasn't been of much use to myself.
Selenium IDE is a Firefox plugin that allows you to record your browser activity and export it to WebDriver C# code.
i've been looking for something similar for a while and came across this article on sauce labs which helped me quite a bit...
http://saucelabs.com/blog/index.php/2011/12/selenium-testing-framework-part-3-putting-it-all-together/
I have went down this route using the open source Selenide framework for java tests.
The fact that there is no de-facto standard selenium framework should be a sign that it isn't probably a good thing to. I would not recommend using a framework, I failed 2 times writing a testing suite because of it.
On the other hand writing a testing suite with very good OOP structure reflecting the webpage you are testing has worked wonders for me. The key is isolating the actual selenium webdriver code from the tests. You should very rarely use the reference to driver in tests, but instead initialize objects offering services (e.g. UI actions) representing the page elements you want to interact with and test. This is an ok example of this abstraction using the FindsBymethod in C#. The Page Object Model here is more or less what you should be going for.
It's alot of work to write a meta-application for UI testing instead of just copy and pasting recorded actions into code, but it does lead to more robust, reusable, and valuable tests.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
i got a project where i must create à web application based on ASP.NET (C#), i need to generate dynamic statistic into a dashboard, the data is extracted from the database. the user can export to XML or CSV file. My database is on SQLserver express 2014 and i m using visual studio 2013.
Looking for advice, what sort of technology to study .
thanks.
Dali, you haven't mentioned if you need to use MVC or WebPages for your project so I will assume it's MVC. However, you can apply the same steps to WebPages with slight modifications.
There are MANY ways to build a dashboard in ASP.Net. Each has its own pros and cons. Please, use your own judgement. This list is nowhere near complete so I would recommend to search possible options online.
1. SSRS Dashboard
Many developers think it's an outdated technology, and, while I agree with them, I still think it's worth to learn if you're trying to implement Reports repository with basic functionality (daily snapshots, parameter filtering, report scheduling). SSRS supports different formats like Excel, HTML, XML, PDF. It's easy to learn and very intuitive. It uses Visual Basic for scripting, and can be easily integrated in .ASPX web pages.
Take a look at some examples.
2. R + MVC
This is a good option for the statistical dashboard. I personally have no experience using R so I cannot tell for sure if it's a viable option in your case. However, it's something to consider when you do your research. Here is a good example to get an idea.
3. JavaScript Chart Library + MVC
Here is good a example. For the JavaScript library, you can use either D3 or HighCharts. Both are great and powerful. Both can be easily integrated with .Net framework. Also, this option is recommended if you already know the JavaScript. There is no need to learn anything else.
4. AnjularJS (or any other JS framework) + MVC (or RESTful API)
This one is my favorite because it provides a lot of room for customization and is flexible enough to satisfy your client needs. Some developers avoid using MVC and replace it with WebAPI (or even SignalR). This also a great solution and allows you to reuse the code if you decide to build a public API based on your dashboard data in real time. Here is what I'm talking about.
P.S. In all these options, SQL Server is used as a main data storage that is why I decided not to include it everywhere. Since you are a .Net developer, it's an obvious choice that you stick with SQL Server, in my opinion.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Today I've been bouncing all around the internet, and after reading up on a lot of solutions I've decided that writing a Chromium wrapper would be an interesting learning experience; not to mention it would be worthwhile for several projects that I am currently working on.
I know that there are already some wrappers out there (awesomium, berkelium), not to mention some basic tutorials like this one, but I'm looking at writing my own wrapper.
My main interest in doing this is so that I am able to create and access the DOM structure generated by WebKit for use in C#, both before and after any javascript which the html depends on has been ran. I know I could look at using the HTMLAgilityPack and Majestic12 for HTML parsing, but I'm looking to build something on top of a tried and tested engine that is fast, efficient, and will be actively developed for the foreseeable future. WebKit is an actively developed layout engine embedded in some of the most popular browsers, and V8 is an impressive javascript engine, hence the decided use of Chromium.
Seeing as how I do not care about actually rendering any content and instead I am looking to access the structure of the web page, I feel that embedding WebKit in its entirety could potentially be overkill. Even in the instances where I'd like javascript to alter the DOM, I still have no use for rendering the results.
In summary:
All I truly want from Chromium is the ability to create the DOM of a web page, and (optionally) the ability to run said page's scripts using Chromium's impressive V8 engine to further manipulate the DOM. I know that this will be quite an undertaking, but I'm interested to see what you have to say. In short, has someone worked with WebKit and V8 (possibly via Chromium), who could assess the feasibility of this and lend me their expertise (via recommendations for how to approach this)? I know that I could eventually determine an appropriate way of approaching this, but I'm looking to expedite the process a bit. Links or perhaps a relatively short and sweet high-level "This is how I'd do it" are what I'm looking for (aka I don't need anything too terribly fancy).
I'm hoping that what I'm asking isn't too scatter-brained. If you find it too general and want to close this topic, instead of doing so please leave a comment and I'll try to narrow the focus. As I just stated my mind is bouncing around today since I'm coming down with a cold.
I'm on the same path. I'm looking deep on QtWebKit and the implementation done on PhantomJs which is a Selenium like, and worked like a charm on my tests.
When you use QtWebKit, as your driver to WebKit youll save time for next releases of it, because maintain a WebKit Port its not that easy.
I use Selenium Webdriver with ChromeDriver for automated script, web page and acceptance testing. Easy to set up, easy to use.
The idea is that you can use this existing interface, but change the path to the Chrome executable with ChromeOptions.BinaryLocation. Try pointing it to one of the existing headless builds of WebKit, like WebKitDriver - it might just work.
Our goals might be different, but I'd be interested in a headless version myself. It would be less obtrusive during testing on my dev machine, and I already take automated screenshots when a test fails.
selenium webdriver google-chrome chromedriver
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Can anyone help me how to do UI Automation in WPF? I want to check the operation of a Grid.
If you just want to automate WPF and NOT WinForms, check out Telerik's free framework. There's also a paid version if you want more features like record-and-playback.
Two open-source C# libraries that support automation of both WPF and WinForms controls are:
White
I've used this, and found it to not always be reliable.
QAliber
I've used this, and found it to be good but needing work.
Both are open-source, so they'll show you how to use Microsoft's API's, and you can modify them to meet your needs.
I've also used Coded UI Test and Ranorex, but they're both $$, and I don't care for record-and-playback because I feel it's a maintenance issue. (Although QAliber does have a record-and-playback feature and White also has an alpha-quality recorder.)
Of course you could always go it directly from Microsoft's API's if you really want to get down and dirty.
Use the tools built into Visual Studio - Coded UI Tests:
http://msdn.microsoft.com/en-us/library/dd286681.aspx
There are two methods of doing this: Record and generate code (tends to be a good starting point, but often doesn't give you reproducible tests), and manually coding them up via UI object tree.
I ended up doing the second option most often, because I liked the code I wrote much better than what the recorder functionality offered.
You can try PROJECT SIKULI:
Sikuli is a visual technology to automate and test graphical user
interfaces (GUI) using images (screenshots). Sikuli includes Sikuli
Script, a visual scripting API for Jython, and Sikuli IDE, an
integrated development environment for writing visual scripts with
screenshots easily. Sikuli Script automates anything you see on the
screen without internal API's support. You can programmatically
control a web page, a Windows/Linux/Mac OS X desktop application, or
even an iphone or android application running in a simulator or via
VNC.
Here is a good blog post to get you started on UI Automation:
Silverlight UI Automation Testing using Prism 4.0
It's Silverlight based, but the Silverlight is very close to WPF, and the UI Automation concepts involved are exactly the same.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Just curious: What do you find to be your best tools for creating automated screen scrapes these days? is the .Net Agility pack a good option? What do you do about scraping sites that use a lot of AJAX?
I find that if the page has a pretty static layout, then the HTML Agility Pack is perfect for getting all the data I need. I've not run into a single page that it hasn't been able to handle and not get me the results I wanted.
If you find that the page is rendered with a great deal of dynamic code, you're going to have to do more than just download the page, you'll have to actually execute it.
To do that, you'll need something like the WebKit .NET library (a .NET wrapper around the WebKit rendering engine) which will allow you to download the page and actually execute Javascript as well. Then, once you are sure the document has been rendered completely, you can get the page details.
For the very basics I use:
Asynchronous HTTP Client - notably faster than the standard HttpWeb* (preliminary tests showed that it was about 25% faster).
Majestic 12 HTML Parser - about 50-100% faster than HTML Agility Pack.
I don't have JavaScript enabled yet, but I'm planning on using Google's V8 JavaScript Engine. This requires that you make calls to unmanaged code, but the performance of V8 justifies it.
For automating screen scraping, Selenium is a good tool. There are 2 things- 1) install Selenium IDE (works only in Firefox). 2) Install Selenium RC Server
After starting Selenium IDE, go to the site that you are trying to automate and start recording events that you do on the site. Think it as recording a macro in the browser. Afterwards, you get the code output for the language you want.
Just so you know Browsermob uses Selenium for load testing and for automating tasks on browser.
I've uploaded a ppt that I made a while back. This should save you a good amount of time- http://www.4shared.com/get/tlwT3qb_/SeleniumInstructions.html
In the above link select the option of regular download.
I spent good amount of time in figuring it out, so thought it may save somebody's time.
The best tool "these days" is one that not only gives you the desired features (Javascript, automation), but also the one that you don't have to run yourself... I am, of course, alluding to using a cloud service. This approach will save you network bandwidth, will deliver results faster (because it can scale better than a custom solution you'll likely end up developing) and, most importantly, save you the IT and maintenance headache.
On that note, check out a scraping solution called Bobik (http://usebobik.com). I've written an article about it at http://zscraper.wordpress.com/2012/07/03/a-comparison-shopping-android-app-without-backend/.
Hope this helps.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
We've got a WPF app we'd like to run automated smoke tests on it. Simple tests like load document, save document, etc, etc. I was wondering if anyone could suggest existing frame works or applications that would help with that.
Thanks!
For testing frameworks both NUnit and MSTest are good. MSTest does have the advantage that it integrates very will with visual studio, so that makes things a bit easier. (There are nunit addins available for vs, but they are quite as fully integrated as mstest).
In terms of how you write the test, if you have written you app according to the MVVM pattern it's pretty simple to have your tests create and run your app using the view models and the commands without actually creating a view.
Even if you haven't used MVVM, hopefully you've still abstracted your logic layers away from your gui, so your tests can call into them without too much difficulty.
In terms of actual GUI testing, you can take a look at the MS UI Automation framework which should allow you to automate parts of your UI to run tests against it. There's a blog post here about how to get going with that, and an article here. There are also some commercial frameworks that overlay the UI automation stuff to make it a bit easier. One example is testautomationfx.
As a spoke test should be “end to end”, then I would look at automated UI testing tools like Test Complete, rather than unit testing tools – scripting the creation of a VM and then run yours installers is another good option.. You spoke test should include the installer for your app, as they tend not to be covered by unit tests, or used by your developers.
You are trying to avoid your testers spending time on “hopeless” builds – hence the need to include the installer.
Think of all the “daft” reasons that stops your test team being productive after they have spent time installing a new build – how many of these can you include in an automated system without having tests fail due to changes in the app.
A lot of people make the error of trying to cover too much in a spoke test – “deep testing” that covers all your logic should be in unit tests and/or “story tests” not your spoke test.