3

In our web-application(built on Bootstrap and Angular), certain tabs in the navbar are displayed only to particular users. Certain input boxes/ buttons are enabled only to certain users. I want to write test scripts using Selenium/ Sikuli to test this functionality and I want your suggestions in this approach.

One of the ideas is to navigate to different pages in the UI, and use Selenium's isDisplayed() and isEnabled() functions and make assertions. And capture screenshots accordingly?

The other idea is to use Sikuli and match certain submenus being present on hover, capture screenshots and compare with the expected.

Which approach do you guys think is the better one to use? Also, please suggest if there's another way to do it.

Would also be so glad if you guys can provide me a generic method to test this.

3 Answers 3

0

I would suggest go for selenium. Sikuli is pixel based image identification tool and it would fail if monitor for system on which you are running tests change. Also selenium gives you many more flexibilities like possibility of execution on grid which would get limited with sikuli. Specifically for user or permission level based testing i would recommend: 1. Create different tests to validate objects for specific user permissions accordingly 2. If all tests are related to permission levels then you can have a assertion wrapper which would assert different things based on logged in user.

0

I think Selenium way is the best way to go.

In addition to the methods mentioned by you you can also try to set up a positive test (if you know for sure that the object will be visible for the user) to make some interaction with the object. For example, selecting the radio button or navigating to the link. This can also be a test in your suite.

0
0

Use Protractor instead of Selenium if its angularJS application and use 'userRole' just as another test data in a data driven test with different users as iterations.

Your Answer

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

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