Hot answers tagged browser-automation
9
You mentioned abstracting your test code from the framework. The page object pattern is one way that this can be done and is fairly common. It is popular with Selenium but can be applied to any UI automation: http://code.google.com/p/selenium/wiki/PageObjects.
You can avoid using xpath that contains the entire path (or even part of the path) to the UI ...
8
If you can, try & promote the idea of test first development (aka TDD, BDD, ATDD, Specification By Example) with Continuous Integration (frequent commits to a pipeline such as Hudson or GO from Thoughtworks which continuously runs the automated checks to see if any of them have broken after a recent commit)
Before Developers write the code, they write ...
7
These days, I'd say Selenium RC is not worth learning unless you have a specific need for it--for example, to work with legacy test code that uses it.
I don't think it will give you a significantly better appreciation of the Selenium architecture. You can get that by exploring the Selenium code base if you have an interest.
If you the know WebDriver API ...
6
You've got quite a few questions in your one question, but overall it sounds like what you want answered is: How can I learn to write automation so I can switch from a 100% manual testing role into a role that involves writing automation. I'll get to answering that one, but first...
Honestly, if you are already manually testing in your current position, ...
5
Selenium solves a large part of cross browser testing. 90% I would say. Selenium is good for web testing across browsers. For UI related stuff adhoc manual checks are sufficient. I used to do manual checks to verify look and feel of UI (Text Sizes appearing small in a browser, Alignment Issues)
Functional UI testing in selenium across browsers verifies Id's ...
5
Automated, parallelized, cross-browser testing is a seductive idea, but in my experience, the cost may not justify the benefit. I do not know whether your customer requests are based on actual experience or the advice of a trusted professional or the unfounded claims of someone in an elevator.
You may spend a lot of time maintaining your cross-browser ...
5
I am using Selenium 2/Webdriver with Visual Studio and MSTEST. Really MSTEST and NUNIT have pretty much equivalent functionality. Unless you want to really get crazy, either should have everything you need for the purposes of executing your automated tests. MSTEST is the command line version of the built in test harness for visual studio. One limitation ...
5
IE 7 is expensive to support at my company. It is encouraging to hear that Microsoft will force automatic update users to upgrade to IE 8 or IE 9.
If you host your own product, you should be able to analyze your web server's access logs to determine the market share of each browser version. With those numbers in hand, you can evaluate tradeoffs between ...
5
When I'm automating a test, I often make the test wrong in some small but meaningful way, then run it with the expectation that it will fail. For example:
If the system is supposed display "42" in the "meaning-of-life" field, I'll change the the test to assert that it displays "43".
If the system is supposed to display "42" only when the current user is ...
5
You want to wait whenever there's a condition that must be satisfied before the test case can proceed. Waiting for a page to load is one such condition; another might be waiting for an AJAX interaction to finish, or for an error message to display.
Sticking a wait() after every action is not productive. Sticking a wait before every action that must occur ...
4
Just use Coypu. It is a wrapper for Selenium/Watin etc., so you can easily swap to another framework later on, and it's heavily maintained. I wouldn't use any other layer. Much more maintainable. As it is available via Nuget und references the Nuget Selenium package, you always stay up-to-date via a simple UpdatePackages from within VS.
Combine that with ...
4
In his own inimitable fashion, QA Hates You posted a blog on this very topic
http://qahatesyou.com/wordpress/2011/12/dont-base-your-compatibility-matrix-on-a-press-release/
"Nor will it force updates on consumers who have already declined earlier offers to abandon an older IE"
4
I'd recommend seriously looking at building a framework that has the absolute minimum of repeated script code - this has the advantage of minimising update work. Similarly, I'd consider data-driven scripts with an object-oriented framwork where you're building your transaction objects to harness the application's features.
That way, as the application ...
4
Selenium is mostly a functional testing tool. So any issue that you find using selenium will be across all the browsers
No, that's not actually the case. Some functionality can be broken in some browsers while working in others.
For example, for one of the apps I test, I've seen significant functionality issues going from IE 6 to IE 7 to IE 8.
4
Quite simply No!
WebDriver was a project in its own right before it merged with Selenium so looking at the Selenium RC codebase and API is not going to give you any insight as to why certain decisions were made inside WebDriver.
Selenium RC is currently deprecated, so if you do start learning it you are learning something that is no longer supported and ...
4
In your comment you mentioned that the element is within a <frameset> \ <frame>. To work with any element within a frame, you need to first switch the context of the driver from the main page to that frame:
driver.switchTo().frame("foo");
In this example "foo" would be the name of the iframe. You can also do it by index if the frame has no name ...
3
What type of machine are you running it on? Most likely it has nothing to do with TestNG having any type of thread limits (I couldn't find anything saying there were in fact limits) but rather your local box. Thread count limits on Windows or Linux are determined by the stack space. Explanations can be found here and here.
On Windows the default stack size ...
3
I would like to recommend Acceptance Test Driven Development (=Specification by Example) technics. You will be surprised, because acceptance tests will find about 80% of the show stopper bugs (if you have some).
The good point to start and listen a real stories from the experience of different agile teams is the (video) Podcasts section on:
...
3
It is not necessary to create a new instance of the driver object. You can use JavaScript to open a new window which is a lot faster.
To open the window:
IJavaScriptExecutor jscript = driver as IJavaScriptExecutor;
jscript.ExecuteScript("window.open()");
Then to switch windows, use the window handles:
List<string> handles = ...
3
The only sure way is to use virtual machines.
Things like IE tester emulate older versions of IE, but they a locked into using the current set of DLL's loaded into windows. You will see errors in the native version of the browser that you do not see in IETester (and things like it).
I know this to be a fact because I have previously used IE tester to ...
3
This is possible with Selenium 2 and WebDriver. I'm not sure if it is with different versions. In Selenium 2 with WebDriver you can call webDriver = new FirefoxDriver(); which spawns a browser, and that browser will stay open for the duration of your testing, or you can choose to close it with webDriver.Quit();. I like to close my browser window between ...
3
Currently, my setup is Visual Studio 2010, Selenium 2, SpecFlow or StoryQ, and NUnit. Since Visual Studio is what I'm most comfortable in, I wouldn't have it any other way. Selenium/Webdriver's libraries work great in there as well.
As far as NUnit within, it also works great. Typically, for simiplicity sake, I create each class as it's on test fixture. ...
3
I haven't used it, but possible it may be helpfull for you:
FiddlerCore
And one more alternative:
BrowserMob Proxy
3
I think you are asking whether you need meta-tests (automated or otherwise). Of course, how do you know that a meta-test is correct? Here is what most developers do: if something feels risky, they test it; otherwise they trust that their code is correct. If something that they trust turns out to have a bug, they try to re-calibrate their judgement. You ...
3
Welcome to SQA, Jacob. First of all, it is understandable that a low-wage intern would want to find a higher-wage job. It is certainly possible to make a decent living as a manual tester. You said you are looking for a new job but are having trouble getting calls back. When I graduated from college, I had no idea what was important in a resume. If you ...
3
Maybe this question I asked several months ago on stackoverflow can do some help to you: http://stackoverflow.com/questions/9781940/selenium-vs-webdriver-any-obvious-advantages
Although I said I decided to use RC at that time, I turn to webdriver short after that. Yes, webdriver has problems, but it is upgrading time after time. I would rather try the new ...
2
To make this change for "As an admin" you will need to change the code that is generated in specflow. This would be the best place for this change IMHO.
As Lyndon suggests, the code that I have written for WatiN should work, but it really depends on how the application is developed.
My other answer copied below.
What I found to solve the "run test as user ...
2
A Google search with the keywords "browser test automation framework" will yield many links for you to check. These frameworks usually handle mouse clicks and keyboard pressing. I do not recommend using different software for automating mouse clicks than for automating keyboard pressing. If you believe you have special needs that would motivate doing so, ...
2
Start early, even before the actual software.
This will give you many benefits-
1. You have the luxury of evaluating several tools or automation designs
2. Your tools, even if not complete, can help the developers test their code in early stages.
3. Your final product (i.e. automation code) will be better suited for the actual product
4. Bringing up your ...
2
As an alternative to simply making sure the values match completely every time, you may be able to create a little more reliable automation by checking things like certain elements don't intersect or element A is always above element B, etc. This would require creating some additional functions to test these things. This will give you some automated ...
Only top voted, non community-wiki answers of a minimum length are eligible
