Skip to main content

Posts

When Test Automation Fails and exploratory Testing rocks

This post describes how I discovered a defect which allowed me to gain higher privilege than I was supposed to as a normal user. When testing an application I came across a use case when a privileged user would be allowed to delete a team and non privileged user would not be. Delete operation is controlled by displaying of a link. This is how it looks like for a privileged user - And this is how it look for a non privileged user - Here “Delete team” link is missing for non privileged user. Having a look at html source code, I found following for the privileged user - <a class="delete right" data-bind="if: teamProfile().type() != 'official', click: deleteTeam" href="https://test.com/" title="Delete this team">Delete team...</a> And following for the non privileged user -           <a class="delete right" data-bind="if: teamProfile().type() != 'official', click: deleteTea...

JMeter and Patch Request

I was using PATCH request with JMeter and I get following error - ######################################################## j ava.net.ProtocolException: Invalid HTTP method: PATCH at java.net.HttpURLConnection.setRequestMethod(HttpURLConnection.java:428) at sun.net.www.protocol.https.HttpsURLConnectionImpl.setRequestMethod(HttpsURLConnectionImpl.java:374) ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### The problem lies with HTTP Request implementation being used here. Java implementation of HTTP request does not support PATH request and you should be using HTTPClient 4 implementation to get rid of this error

Is page object returning another page object a bad practice?

I have come across few articles which talk of page object returning another page object being bad practice. The reason cited are following - Tight coupling between page objects and less flexibility Duplication of code as two variant of a method need to be created returning two different page object depending on if operation was valid or not, i.e. - ‘ loginAs ‘ and ‘ loginAsExpectingError ‘ Let’s see following example of page objects wherein a page object class does not return another page object. For the sake of simplicity, I have consider three page object classes - LoginPage class which lets user login LoggedInUserHomePage class which provides services when user is logged in InvoiceDetailPage class using which user invoice details A simplified version of classes would be - public class LoginPage {    public LoginPage() {        if (!WebUIDriver. getWebDriver ().getTitle().equalsIgnoreCase( "login page" ...

When page object returns more than one type of page object

If have have been working with test automation then you would have probably heard of page objects . In a gist, page object provides clear separation of responsibility between who is responsible for testing (test classes) and who is responsible for services provided page (page classes). Page objects are known to return objects of same page when control retains on same page or another page object when operation on one page return object of another page. For example typing in a text box would keep control on same page (hence same page object) but submitting a form with valid data would most probably load a new page (hence a new page object). But what if return type of Page Object is not fixed. For example for A/B variations, user may be directed to one of many possible variation of a page. Hence the resulting page is a page object but you don’t know for sure which age object. This is where java generics comes for rescue, and to be more specific generic methods. Before delving i...