'Opening and Closing Browser

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:

Here is a ss of the code

Any help on this is appreciated.



Solution 1:[1]

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: opening the scratchbook

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: error message when more than one window is found

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:

specifying the testconfiguration parameter for the browser to use

Hope that helps.

Solution 2:[2]

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.

enter image description here

Solution 3:[3]

You can use "close browser" standard module instead of window operation module to close the browser window.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 esefs
Solution 2 Jayesh Babu
Solution 3 vysakh