Hot answers tagged

13

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 tests ...


13

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 ...


11

Do you think that time is the problem here? If so try to increase the time you are providing in Thread.sleep(); and see it that works out for you. If its not the time, then did you try to find out what the problem is? Are you getting any error?


9

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 ...


9

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 ...


8

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 = driver.WindowHandles....


8

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, ...


8

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 ...


7

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.


7

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 "...


7

The main differences between Appium and AndroidDriver/iPhoneDriver are architectural. The AndroidDriver/iPhoneDriver work the same basic way - they are applications you launch on the phone that create a webview that you can remote control with selenium. The limitations to this approach are: No control over hardware/operating system. Webviews are not a ...


6

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 ...


6

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 ...


6

IMHO, a team lead who is a developer with less knowledge in testing, is the wrong kind of person to be selecting a test tool. Do you have any QA Professionals on your team - perhaps someone with test tool experience? Or, lacking that do you have anyone on the team who will actually be tasked with using a test tool? I would suggest you turn to them. If ...


6

You can try setting implicit wait time. (Documentation) // 5 seconds implicit wait (C# code) IWebDriver driver = new FirefoxDriver(); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));


5

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 ...


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

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 ...


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

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 ...


5

I haven't used it, but possible it may be helpfull for you: FiddlerCore And one more alternative: BrowserMob Proxy


5

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 ...


5

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 ...


5

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 ...


5

Webdriver is not only more modern. It is future W3C standard. Being able to click on hidden links seems like a misfeature. I would use old version only if newer version was seriously lacking important features without which I cannot live.


5

The JSON Wire Protocol is on it's way to becoming accepted as a W3C standard. This means that moving forward, the vendors behind browsers will have much more incentive to implement and maintain implementations for their browsers. Some vendors such as Mozilla and Microsoft have already taken over maintenance of the drivers used by Firefox and Edge. I heard ...


5

Yes, you can use NUnit for functional testing. But still it is a unit-testing framework. No, you are not creating unit-tests by using a unit-testing framework to write functional tests. A unit-test is testing just a single methods input and output, by writing end-2-end tests it by definition cannot be a unit-test. :) Unit testing frameworks are often ...


4

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. ...


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

Phrase "sometimes works sometimes not" often means that Selenium tried to make an action when that action was unavailable at that time (the easiest method to check is to make long pauses before each action). In this case I recommend for you to make your own custom method WaitWhileProcessing which commands WebDriver to wait until full page is rendered. How ...



Only top voted, non community-wiki answers of a minimum length are eligible