I did not find what I'm looking for on different sites.
In fact, when I write my tests with NIGHTWATCH for WEB forms, I have to re-test my entire test each time I want to check something that I have just corrected.
Is there a way to keep the browser open on a page to restart only a small part ? because it can be very long on forms tests with several pages or tabs.
Thanks,
Related
I have built an automation framework for testing our web app that runs as after each new deploy to our staging environment, as a regression pack. Now the issue is the tests fail whenever there's a new experiment that touches that specific part of the tests, e.g., the home page validation tests fail if there is a new home page experiment. I'd like to know how I can make my tests robust enough to resolve the issue maybe by ignoring experiments altogether or always ensuring the page loads in the current non-experiment group?
I thought maybe a possible solution would be for the web team to write a new cookie than controls the experiments, and then just set that cookie in a hook prior to my tests? Would that work or is there maybe a better way?
The solution with the cookie that controls your A/B experiments will work well with TestCafe. TestCafe allows you to work with cookies using the ClientFunctions mechanism or Client Scripts.
I'm using Serenity jbehave to automate my webapp, and I got trouble in keeping one browser instance through the test.
My app need to login to perform any test, so I don't want to start new browser and login again and again every story.
I tried the setting below but it seem not work as expected. I am using Serenity 1.5.rc-1 with latest Firefox and Chrome, my test always open new browser every story run, if I run 5 stores, then there are 5 instance of Firefox open.
I googled for 2 weeks, but I'm still stuck.
Please help!
serenity.properties
serenity.use.unique.browser=true
serenity.restart.browser.for.each=NEVER
restart.browser.each.scenario=false
JBehave doesn't support using a single browser across all stories (there is no way of knowing when the suite has finished running, so no way of knowing when to shut down the browser cleanly), so the optimal setting is
serenity.restart.browser.for.each = story
This is actually a good compromise, as some WebDriver instances can become flaky when run for too long with the same browser.
I have a project that requires automating a process on a website (login, click buttons, make decisions, etc.).
Ordinarily I would use something like curl to do the automation and not worry about the UI at all, however this site uses ASPX and redirects and is just a mess, so I need to write something like a selenium test to do it.
A selenium seems like a bit of a hack though, so I was wondering if there is any alternative or tool that may be better than selenium at walking the dom and "clicking" elements?
Guidance or examples appreciated.
A non programtic way would be to use Selenium IDE. Basically you record the events via a Firefox extension and can replay easily. I understand this is a non automating way as it requires a manual playback.
However one element that I really like is that I can use this extension to record my events and then generate scripts to automate playback via Selenium Remote Control drivers.
Selenium IDE is an integrated development environment for Selenium
scripts. It is implemented as a Firefox extension, and allows you to
record, edit, and debug tests. Selenium IDE includes the entire
Selenium Core, allowing you to easily and quickly record and play back
tests in the actual environment that they will run in.
Yes I know you think selenium is a hack but it is rather pretty good!
Wondering if there was some sort of crawler we could use to test and re-test everything when changes are made to the web app so we know some new change didn't error out any existing pages. Or maybe a web browser with a million frames so I could scroll down and look through the tiles to find any error pages... you get the idea.
Selenium will let you test forms and write and automate scripts. This is a firefox add in and is quite powerful. You can manually write the scripts and also "record" them
Jmeter will let you create scripts and then run them as multiple users to test and load test web sites as a whole. This a stand alone application and can mimic multiple users and randomise access etc. and loading to stress test the application.
You could presumably use both to error test by monitoring the output logs from them to catch errors.
Both will allow you to authenticate to log on to sites.
I want to test a Ajax based web application. I want to write the test scripts in Java and simulate the web browser.
Simulation of a web browser is very important since Iam using very advanced Ajax library like jQuery in the web Application.
Any ideas on how I should proceed?
I think you might want to give Selenium a look.
Kindness,
Dan
Doing "simulation" of a browser will probably not work that well if your application relies on Javascript a lot : there are some crawlers that you can use to test your application, but they don't like JS that much.
The best solution in your case might be to use a real browser to do your testing.
The Selenium tool-suite is quite nice for that : it allows your testing programm to pilot a browser (a real one : firefox, internet explorer, ...) ; which mean having you JS code executed exactly the same way that it would be with a "real" user.
For instance, you can have your testing programm tell a browser to open a page, click on a link, check some content in the page, ... And if there was some JS event plugged onto the link, it will have been executed : there will have been a real "click" on the link.
Using a tool like selenium has some drawbacks, though ; some of them are :
you need a machine with a graphic environnement, to launch the browsers (command line is not enough)
tests with selenium take time : browsing and using the application means loading all the CSS/JS/Images/ads/whatever, for each page ; like in a real browser -- because you are using a real browser
But these tests are quite nice, and usefull to test the application as a whole -- ie, more "functionnal tests" than "unit-test".