3

I need to test a suite of ecommerce websites which are more or less similar in technology and functional flows.

Which automation framework will allow me to test a single portal end to end and also to test selected functionality across multiple portals.
I considered POM but there is quite a lot of duplication in it because some flows and pages for things like login, registering, etc. are the same for all.

I tried a library style approach for each but that requires too many ifs and buts in script and is too fragile for then requirements change over time.

2
  • 2
    Reworded to improve and try to make the question more specific. General "recommend software to do x" questions are usually off-topic on SE sites. Oct 17, 2015 at 12:39
  • Thanks everyone for answers I think combining Kate Paulk and JustaRandomGuy approach would suite me best
    – MagicBeans
    Oct 28, 2015 at 16:42

5 Answers 5

2

Well, I feel you should try to put POM in the following way:

  • Create a super class in which you can contain your common objects, which can be re-used there by avoiding duplication.
  • Divide your child POM classes as per functionalities. Say: Login keeps all objects related to it in a class file, so this class will have all login objects for different portals(I hope I made myself clear).

Try to implement modularity by making your tests, functionality specific, say Login based on different page objects as inputs you can verify the functionality across portals using a number of scripts (based on your requirements).
All I wanted to convey here is a Login package will have all test scripts related to it.

To verify on single portal or multiple can be easily done if you follow above and design your test suite accordingly.

1

You have three broad choices:

  • A fully built out tool center
    an example of a fully build out tools center is HP Quality Center

  • A programming language & framework(s)
    For example Ruby, Python or C++ that allows for logic, conditionals, variables and functions. I would choose a framework such as ruby's rspec and capybara to write the code. Another option to consider is Jasmine which will actually run its cases in a browser. Which framework to choose may depend on the existing back end technology.

  • Selenium
    You can use the selenium IDE to develop some simple prototype cases but you will want to export/switch to the above solutions for the functionality you need. Another option is to use selenium with a programming language by using its webdriver approach. Lots more on that on the selenium web site.

3
  • That much I have worked it out that I am using selenium webdriver not IDE, but which design to use in that is what am trying to figure out.
    – MagicBeans
    Oct 19, 2015 at 4:59
  • Use javascript variables for page objects (element identification). Oct 19, 2015 at 11:24
  • I am not familiar with this , could you please elaborate or share a link where I get an idea about this
    – MagicBeans
    Oct 19, 2015 at 15:10
1

Most frameworks can do what you need for this, but there will be a fair amount of custom code needed.

You can use Page Object Model with inheritance as JustARandomGuy has suggested. By creating a base login class with the common login functionality/features and using an inherited login page object for the aspects of login which are unique to the page you can keep your code much cleaner.

Another method that helps with this situation is to use a config file with your script runs - let the config file define all your objects and groups, e.g. if the functionality of the login page is the same across all sites but the field is named differently, you might build your config file something like this:

<site>
    <sitename>Site1</sitename>
    <pages>
        <page>
            <pageuri>/login</pageuri>
            <username>txtUserId</username>
            <password>txtPassWord</password>
            <submit>cmdLogin</submit>
        </page>
        <!-- etc... -->
    </pages>
</site>

There are other ways to store that kind of information - but if it lives in a user-editable location outside your code-base, it becomes much easier to handle any changes to page schema or field names.

Within your script, you'd reference variables that pull from the reference file for your site data, so instead of something like FindById('txtUserId') you might use FindById(useridFieldName) with the value of useridFieldName set on load of the module.

I've used this approach in some very large (1/2 million lines of code, plus at least that many rows of data) automation projects, and had a lot of success with maintainability and extensibility. I've been able to add new functionality by adding four rows of data, and maybe a dozen lines of code.

1

My two cents: Telerik Test Studio. It can do anything. No really, if it's not built in, just write some C#. I have done RESTful API tests, UI automation, and load testing (to name a few). It's great but comes at a price. Use it a little and compare to all the stuff you have to setup with something like Selenium and its easy to show the bosses that the initial purchase is covered by the time it saves you. It is certainly cheaper than many other options like UTP and MTM.

1
  • We have also suggested Test Studio to our client and after doing a detailed analysis and POC of te tool, I found it really enriched in features, it requires only little coding steps at few points (that too are provided by Telerik support team). As said above, price too is not that huge as compared to others.
    – Dhiman
    Oct 20, 2015 at 14:14
0

I would go down to the protocol level as:

  1. You won't be sensitive to markup changes, request/response + assertions should be enough to check baseline functionality
  2. HTTP request-based scripts are easier to maintain as they're not so fragile and development is much easier as record-and-replay is more likely to be repeatable than UI-based test which you need to do from scratch
  3. test execution time will be much faster as it won't be necessary to actually "render" page
  4. functional tests can be converted to load tests at any time
  5. coverage will not be limited to HTTP protocol only, you'll be able to handle situations like NTLM/Kerberos SSO, executing database queries using results for assertions or parametrisation, test FTP servers, mail servers, etc.

The most promising free and open source tools for the moment are:

See Open Source Load Testing Tools: Which One Should You Use? guide for comparative view of the aforementioned tools.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.