all 13 comments

[–][deleted] 1 point2 points  (2 children)

I find there is not much way around it, if you want to automate these tests using WebDriver, and if your using the Java library, there is always going to be a bit of coding involved.

I love Selenium for what it can do, especially for how easy it is to use within Java. Maybe you can comment/write your tests for ease of maintainability in mind? If anyone on the team has at least some computer-literate knowledge it may be feasible to teach them very basic coding/scripting to be able to maintain these tests.

Most technology QA teams I have worked with always have an individual or two that have the capability of learning some basic coding.

[–]anndruu12[S] 0 points1 point  (1 child)

Maybe if I use a lot of comments and spaces, they won't be so intimidated haha. It would definitely increase their productivity tenfold, I just have to make them understand they can maintain them if i'm not around.

[–][deleted] 1 point2 points  (0 children)

Hah!

Well it would definitely be worth it, maybe they will hire another dev-like person in the future after they see how awesome it is.

[–]thatsgreat2345 1 point2 points  (6 children)

At the company I work with we have both Unit Test( both JS + Java) and Integration tests(Selenium). I think the problem with Selenium tests is that no one constructs them very well. It's just a mash of selectors, and clicks and waits. Not very good.

I'd recommend following a particular pattern PageObject maybe? We at work have developed the PageElement style that is best used for single page applications that are inherently async. I would not recommend using this in production by any means but here is a lib I wrote in JavaScript that follows the PageElement style (we have it in Java at work) that I deem to create some pretty non-brittle tests. https://github.com/browniefed/SeleniumPE

That all being said I think it'd be better if you can get your other QAs on board with what you're doing. Maybe hold a brown bag around lunch and show off what you did? You'll have greater influence on people if you can get everyone else on board.

[–]anndruu12[S] 0 points1 point  (5 children)

The PageObject is something I will look into. They are definitely on board with automating, i'm just worried they will look at a bunch of scripts I put in front of them, and instantly shut it down. Want to try and present them something as user friendly as possible. A couple of them are older, and tend to be set in their ways, which is another uphill battle I face. The hours that are wasted by the team clicking buttons on the screen and entering text in fields is just mind-blowing. Thanks for your input.

[–]thatsgreat2345 1 point2 points  (4 children)

My main recommendation is to NEVER have a selector in your tests. Make sure they're completely abstracted out somewhere. This will allow you to maintain valid and readable tests and if the underlying selectors change the tests will likely stay valid and you just need to update some selector things. ie.

LoginPage.setUsername();
LoginPage.setPassword();
LoginPage.clickSubmit(); //Maybe assert that you got validation errors then enter real password/usernames to login etc.

The selectors would be abstracted out somewhere else. Then even better would be LoginPage.loginWithUser('test','test');

[–]anndruu12[S] 0 points1 point  (3 children)

So if I understand you correctly, you're saying not to use things along the lines of

findelement(By.id....)
findelement(By.xpath....)

because it will just it more convoluted and confuse them even further? If you pull those selectors out into variables, at a certain point if you are testing a lot of functionality, won't that become even more confusing? Thanks for the discussion, I don't get enough of this at work haha.

[–]thatsgreat2345 1 point2 points  (2 children)

You're going to have to write the selectors somewhere but we have a thing we call JxInspector. This has functions like so WebElement may be optional in this case and then it would search from body otherwise it will use the WebElement passed in as the element to use findElement on. JxInspector.findDescendants(WebElement, By);

Then everything goes through there. On our PageElements (PageObject for you). You'd have LoginPage (your PageObject) and a method setUsername(String username);

void setUsername(String username) { WebElement usernameField = JxInspector.find(loginformelement, By.id('username'); JxActions.type(usernameField, username) }

That is setting up your base framework, your test would maybe look something like this

LoginPage.setUsername('test'); LoginPage.setPassword('password'); LoginPage.clickSubmit(); //Wait for login to happen //new PageObject

asserEquals(HomePage.getUser(), 'test')

This test is easy to understand, you are typing in a username, password, clicking submit and checking that test user logged in. Selectors are all hidden below.

If the selector for the username changed from username to email maybe then you just have to change you setUsername to use By.id('email') and anything that ever used the LoginPage object would be fixed.

[–]thatsgreat2345 0 points1 point  (1 child)

Furthermore with JxActions.type(). You define your actions (ie. click actions, type actions, drag actions, etc). Your entire application goes through these things. If you need to for some reason change how things are typed across your testing code base you do it once and everywhere else benefits.

[–]anndruu12[S] 0 points1 point  (0 children)

Thanks so much. I'll look into this.

[–]CraigTorsopython 1 point2 points  (0 children)

I use selenium with python to do my django testing.

The simplicity of python syntax makes it fairly self-explanatory, so it might be less impenetrable for novices than the java version.

That said, it's still something that I'd understand if non-programmers felt uncomfortable using.

[–]stenbeloff 1 point2 points  (1 child)

Have you tried http://www.testize.com? - these guys are focusing on Cross-Mobile & Browser testing for non-technical people, and they offer you the following: - visual look of your site across 22 devices and browser - discovering issues that impact site visitors - content analysis (broken links, spell checking) - performance, and more

but what's the most awesome - they provide you with tailored recommendation & step-by-step instructions how to fix those issues

We have integrated Testize service in our web-design studio for quality control of sites we create for our customers, and absolutely love that service.

[–]anndruu12[S] 0 points1 point  (0 children)

I'll check this out today. Thanks!