I am new to TOSCA, kindly guide me How to Launching multiple browsers in TOSCA?
Thanks in advance.
Sreeni
Additionally to what Kapil said above (which was about using browsers), here is how you can actually "launch" (=start) browsers.
Tosca treats browsers like any other application - you can start a browser using the TBox Start Program module (that you can get access to by importing the standard subset).
Tosca's manual actually provides an example of how to start Internet Explorer using that module, it works in a similar fashion with the other browsers. Here is a screenshot:
For the sake of completeness, here's the link to the manual for more details: https://support.tricentis.com/community/manuals_detail.do?lang=en&version=10.0.0&url=ep_tbox/process_operations/process_operations.htm
We cannot trigger multiple browsers in TOSCA, but it supports cross browser execution. For cross browser execution:
1. Create a Test Configuration Parameter "Browser" either at TestCase or at its parent levels.
2. We can choose value InternetExplorer, Firefox, or Chrome.
3. The execution will be triggered on respective browser.
In order to achieve parallel execution we have to go with Distributed Execution (DEX).
Related
I am new to TOSCA (just trying to learn by self-studying - have a trial license).
I was trying to build a simple test case to open and close an application. In it I have used the TBox Window Operation Module to close the Browser but when I run it in scratchbox, I don't get any output. It just opens the browser to the demo app and exits without giving a success or an error message. I want to know why it isn't closing the browser window and giving me a success message.
Here is a screenshot:
Any help on this is appreciated.
Your testcase looks alright to me. I just tried myself and this should work.
After you've run the test you can always open up the scratchbook again, by clicking the 'scratchbook' button in the ribbon on the 'home' tab in the 'go to' group:
You should then see the details of your last run. A very common thing that happens to me is that Tosca cannot uniquely identify the window (e.g. because I have two windows with the same title open). The error would look like this:
So I'd check if opened the demo webshop more than once.
What is also good to know is, that Tosca will use your standard browser in the 'OpenUrl' module if you have not specified it otherwise, and the 'Window Operation Module' is agnostic to that. You can explicitly specify which browser to use in the 'OpenUrl' module by providing a TestConfiguration Parameter like this:
Hope that helps.
just use CloseBrowser module which can be found under Standard Modules.
Standard Modules are the set of modules which are shipped by default along with the installation of any Tosca instance.
You can use "close browser" standard module instead of window operation module to close the browser window.
Does anyone know what are the Google Chrome command line switches that I can use to emulate the device size?
The component that I want to test contains the CSS #media query min-device-width/min-device-height. I tried using the --window-size and --user-agent but I have no luck with those.
Basically, I am trying to write a webdriver test for this component.
There are switches which might help you do that --window-size, --user-agent and --use-mobile-user-agent .Here is the full list of switches. This article also explains how to save those settings as a new app.
I was also looking for a way to trigger chrome mobile emulation tool by command line or using webdriver or simply karma, but according to this answer and chromium team there is no such option yet, but a feature request has been filled up you can vote for.
Regular Chrome does not really support this function, but Chrome Canary is exactly what you are looking for.
https://www.google.com/intl/en/chrome/browser/canary.html
https://developers.google.com/chrome-developer-tools/docs/mobile-emulation
With our CUIT tests in Visual Studio we have the problem that we cannot record the Browser Button action in IE. We just get:
C:\fakepath\Document1.txt
But this obviously does not lead to the real document in a playback. And it's not possible to just type the path into the Browse text field anymore.
Just FYI: This applies to the Coded UI Testing Framework in Visual Studio 2010 Feature Pack 2. The recorder only works with IE.
Any ideas?
Not being able to access the file upload control is supposed to be a security feature. I guess you need to step out of your environment and into the windows environment to accomplish anything.
If you use a macro recorder that can playback from command line (like http://www.jitbit.com/macro-recorder/versionhistory/) or a similar means, you may be able to record the missing step here (like a simple tab key hit - provided you have focused on the control before the upload control -, a typed text, and another tab key hit) and start the resulting "batch". Or you can even record a mouse click.
However, if this test runs in other browsers (if I understand you correctly), wouldn't it be safe enough to assume that it runs in IE as well, because after all you are using a standard control?
Actually, turns out I can edit the value "C:\fakepath\Document1.txt" manually in the uitest UIMaps file and change it to a real path. And it works in the reply like this.
I am trying to debug a large and complex webapp that makes heavy use of DIVs, AJAX, dynamic HTML and server-side code to do its job.
Under normal operation we do not have problems. However, when we put the webapp into an IFRAME, certain functions trigger a crash in IE7 that renders the browser inoperable (all CPU used).
What tools exist to help track down what could be happening? Loading the IE process into the debugger gives me all sorts of fascinating info about the registers, but I think the issue is in javascript.
We have tracked down one problem with the app already that involved incorrect reparenting of an element (something attached itself to window. instead of document.)
I wrote a test IFRAME page that dumps the innerHTML of the iframe into a textarea, so it can be compared during various states, but that only shows me static attributes, I can't tell what sort of javascript events are associated with elements or determine if a handler is firing out of turn.
IE8, Firefox, Chrome etc do not have the same behaviour.
Ideally I'd like something that would let me snapshot the DOM (or the javascript VM?) during a known good state, then "just before it happens" so we can figure out what's added / removed / missing / different. What is out there?
Update: I'm now trying to use the IE Developer Toolbar to track it down.
Update 2: The IE7 crash occurs following this AJAX code:
function Sys$UI$Control$get_element() {
/// <value domElement="true" locid="P:J#Sys.UI.Control.element"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._element;
}
The return this._element; line is the last thing that happens before I lose IE.
IE Developer's Toolbar. Download it here (IEDevToolBarSetup.msi).
For JavaScript debugging refer this blog.
Some guy made a bundle that's called Internet Explorer Collection. It includes some 6 different IE browsers ranging from IE6 to IE8 in different builds. All those include Firebug (really, it sort of works) and Internet Explorer Developer Toolbar.
It was really helpful for me to debug IE7 issues.
see this link.
By placing 'debugger' in the javascript files in places where you'd like to start debugging you can debug the javascript in visual studio as well complete with trace, call stacks, etcetera.
The IE developer toolbar definitely helps alot. Visual Studios's debugger is also very good if you can get a machine with VS and IE7 on it.
DynaTrace is a profiling tool for IE7. However, it provides a great deal of information (including JS stacks), so it can also be very helpful for debugging.
IE 7 and IE 8 has built in debugging tools. Press F12 and you are ready to debug. Also firebug-firefox and chrome's inspect element options are useful/
My team has an automation solution that uses watir. In fact, we have 2 versions of it, one for one release of our software and another for another release. I find that changing versions of watir used it not easy, so I want to select the right version for my new project (building an exploratory framework like Jim Knowlton talks about on Watir Podcast #30).
Our product supports IE and Firefox. It could support other browsers in the future such as Chrome or Safari. Most of the interface technologies are supported by watir, though we created a webdriver framework to have better access to attributes.
So I am thinking that the Watir Webdriver may be the best choice for me today. Not having used it or even reviewed other people's happiness with it, I am just not sure if it is ready. What do you think?
I consider watir-webdriver with the Firefox driver ready for production use at this point, with some notable exceptions:
Frame support still needs more work
Alerts/prompts not supported
Table API is incomplete/unfinished
Having a stable and usable Firefox driver is my #1 priority, so I haven't yet spent much time testing IE, Chrome or HtmlUnit (remote).
The results from our spec suite (the watir2 branch of watirspec) should give a nice indication of how well the browsers are supported:
Firefox: passing: 94%, total time: 201 seconds.
Chrome: passing: 89%, total time: 1207 seconds.
IE: passing: 83%, total time: 2238 seconds.
Please check out the watir-webdriver extension alerts.rb
just do
require "watir-webdriver/extensions/alerts"
alert do
#...code that launches an alert box...
end
confirm true do
#...code that launches confirm box...
end
The blocks even return the value of the confirm/alert box if you want to test for that.
Thanks, Jari
I have used it, and it is pretty good. I have used only Firefox driver, just to make that explicit. I have tried IE and Chrome drivers and those and not as good as FF one.