I have been asked to record a long running scenario which involves pages of functionality for the life-cycle of a patient from registration to billing. I tried Selenium IDE but it is flaky, giving replay errors of what it just recorded. When i try Selenium 2, I get into DOM and XPATH problems. Selenium 2 is meant for unit testing i believe. What are the open source alternatives which scale to 5 minute scenario record and replay ? I know this is a subjective question, which might have been asked before, but the options might have improved.
We use Selenium 2 on a daily basis (driven by groovy scripts but that's not the point) to run long running scenarii involving multi-websites connections [and even mail confirmations verification]. It's very stable when a proper error handling is done. The key to success with long scenarios is "expect to fail". Like in a real world, when you sometime have to click twice on a button
You have to use the WEbdriver and not the recording in IDE.
You have to use Paje Object Model to make the project stable.
see this article:
https://weblogs.java.net/blog/johnsmart/archive/2010/08/09/selenium-2web-driver-land-where-page-objects-are-king
Selenium Web driver will actually work. Xpath problems might be due to page loading time issues.
Include Implicit or Explicit waits in your selenium code.
Even Thread.sleep(milliseconds) will fix the issues to some extent.
I would actually suggest maybe switching over to Watir-webdriver with PageObject if you are going to be using long-running scenarios. We have extremely long scenarios in an AJAX application and could not solve the problem with Selenium. Switching over to watir-webdriver and the page-object gem allowed us to reuse pages with proper waits, and no failures.
Related
I am having a hard time trying to get tests that run fine on Chrome to run in a stable manner on IE.
I have followed the required configuration steps on Selenium's own documentation for IEDriver and I have the 32bit version of IEDriver also installed. I found the steps needed to setup the protected zones and add the registry key was all I needed to get IE to launch and for the tests to begin.
When running the tests I am often seeing intermittent time out related errors like so:
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
I have seen some talk of just increasing timeout settings in the protractor config but this just feels like a magic number approach to me.
I am unsure what else to try right now, so thought I'd ask here to see what others may have done to help them past such issues.
One thing I did come across in a post elsewhere was how Chrome is more 'forgiving' with promises and that to get them to behave with IE, chaining then() callbacks on promises helped. This doesnt make sense to me, since from what I have read about the webdriver control flow chaining like so shouldnt be required.
Can anyone out there share their experiences with testing against IEDriver and if they have ever hit these intermittent timeouts, how have you been able to resolve these?
Thanks
You can have a look at this Post: This more about getting IE to work but maybe som e of the capability setting will help and also you need to configure your IE
How to fix the slow sendkeys on IE 11 with Selenium Webdriver 3.0.0?.
For me it became more stable, when i use Windows 10 IE, but I don't think it's relevant version with Windows 7 IE. I had simular problems on Windows 7 IE version, after a few runs my tests started slow down, and sometimes i get the same error as described. But it was half a year ago, i don't now about current versions, may be it's more stable.
I'm new in tests area. Regression team where I belong has built GUI tests for some web applications with complex business logic that developers team has produced.
Until now, we have been using Selenium IDE to build regression tests (record, edit, parameterize, debug and playback). Tests are exported and maintained in Html format. We used to have a tool to manage tests and iterations (store html scripts/tests suites, run tests in batch mode, run tests in background, get detailed test result reports), which is now deprecated because uses Selenium RC. Additionally, tests are made only in Firefox, but our clients are mainly IE users.
So, we have some important and strategic decisions to make. We need urgently to start testing in IE and a new way to do the tasks we were doing.
An attempt was made to change the code of tests’ manager tool in order to work with Selenium Webdriver. It was tried to code tests in Ruby from the beginning, since Selenium IDE export to Ruby was not satisfactory. We figured out that huge changes and subsequent tests on the manager tool were needed. It would also involve programming the methods and test them.
Our regression team is quite small and we don’t want to focus too much on the programming task itself, but more on testing our webApps. Additionally, no one on the general team had experience in working with Ruby before.
Can you help us with some suggestions about the route we should take?
Is there an integrated solution easy to work with (as Selenium IDE) and able to do the manager tasks of our old tool without taking us much time on “hard coding”?
Is there any reliable open source tool that could do it? And a commercial solution?
I am looking for a general strategy to use Cucumber tests in a Linux environment to test against an Internet Explorer browser. I have seen a similar answer but that does not seem to apply to capybara 1.1.3.
I was hoping to use capybara to avoid using Selenium directly and the subsequent cost (speed, environmental dependencies) of not using headless tests, but it seems that may not be possible. I want to avoid using both capybara and selenium.
A nice compromise may be Ross Patterson's answer to a Selenium based question:
Headless browsers are a bad idea. They get you some testing, but nothing like what a real user will see, and they mask lots of problems that only real browsers encounter. You're infinitely better off using a "headed" browser (i.e., anything but HTMLUnit) on a headless environment (e.g., Windows, or Linux with XVFB).
Thanks for your thoughts.
My current default browser is Chrome (dev). I'm using VS2010 and Silverlight4, with ASP.NET MVC3. I don't seem to have the problems with debugging that I've seen others have. My main complaint is that I regularly have to clear my browser cache to get the latest version of my app to show up. Sometimes I have to clear it two or three times. I've taken to changing the background color of certain elements just to be sure whether I've got the actual latest changes.
Are Firefox or IE better in this regard? Is there are trick to make my latest version always appear?
Too lazy to do fiddler.
Seems I hadn't googled very well before, this article seems to be precisely what I wanted
http://codeblog.larsholm.net/2010/02/avoid-incorrect-caching-of-silverlight-xap-file
via this discussion which has other options and some useful discussion https://betaforums.silverlight.net/forums/p/11995/449355.aspx
Unfortunately, that part of my project has been on hold for a bit, so I haven't tried it out yet.
Like you, I use Chrome for my main browser, and I don't use IE for any regular browsing. But I do use IE for Silverlight development, for this reason and others. I rarely if ever have trouble with the IE cache holding onto outdated versions of my XAP file, but this happens pretty regularly with FireFox and Chrome. In addition, depending on how I closed my previous debug session, when I start up a new one, FireFox and Chrome frequently open up my previous tab(s) in addition to the one that I'm actually trying to debug. Consequently, IE is (for me) the cleanest browser to actually debug with.
This isn't really an answer -- just an observation. Sorry :-).
Have you tried investigating why this is happening using Fiddler or a similar HTTP debugging tool? Personally I've never been able to debug Silverlight in Chrome so I usually have to force IE when debugging. But I never have the problem of a stale application. I'd check Fiddler to see if you can isolate the issue. It's probably not directly related to Silverlight.
Your probleme looks like a lot like a cache configuration issue. The web server is often configurated rather aggressively concerning caching of static files, as the XAP.
So the response header are probably set in a way that maximize browser caching.
You could change the webserver configuration to prevent client side caching of the XAP file.
Don't forget to remove these setting in production, however.
Problem Statement: I have a simple test of "Successful login to web Page". This test to be carried out with 100 different username and password. Requirement is test should hit the server with 100 usernames at the same time.
Information: Do we have to use selenium grid or RC or simple WebDriver, we are free to use any. Reading usernames & passwords from xls, or xml or parameterized junit, we are free to use whatever.
Is this possible?
How can we achieve this?
Yes, it can be done with Selenium WebDriver. If you want to reach 100 concurrent sessions, your best choice is to use an headless browser, for example PhantomJS. Here you have a running example. This example uses JUnit, Selenium WebDriver, and WebDriverManager (to handle the required binary by PhantomJS).
To fit this example into your requirements, you need to change the value of NUMBER_OF_BROWSERS to 100 and then change the code of the singleTestExcution method for your own logic (open your app and do login).
You can also do it using real browsers, e.g. Chrome (equivalent example here). But if you need to reach to 100 clients, this is going to be very expensive in terms of resources (CPU and memory) conmsuption.