Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

The specific tool I am using is Oracle Openscript, part of the Oracle ATS package. However, their web-based component uses xpath-based object identification, so it has a lot in common with other, more popular tools.

The problem I'm having is that after recording a series of navigation clicks on heavily-styled elements (for example, <a> elements styled to look like buttons using jQuery), a simple playback fails to click on them. It turns the correct element pink, which I believe is OpenScript's way of identifying what it's trying to click, but then times out unless I manually click it. Clearly the click event is failing.

I know record and playback is immensely fragile, so I'm trying to build a library of helper functions I can use to build tests in the future. What methods generally do people use to combat fragility of click methods in tools? Surely there's a better way than just trying in a loop until navigation changes?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

If this were Selenium, what I would do is first wait for the element to exist before I tried to operate on it (especially if I'm seeing this problem on IE, seems to be a common annoyance with that browser unfortunately)

Rereading your question, I think something like this will solve it. That you can click it manually after the tool loads the page and fails to execute the same click indicates a likely race condition.

I think there is a way to do this with OpenScript, according to this oracle doc, by setting a separate wait for a particular object like the anchor tag.

Expand the Object Timeout group and set the preferences as follows: Timeout(S): Specifies the maximum number of seconds OpenScript should wait for an object to appear before considering the object not found. This is the default timeout when waiting for an object to appear before invoking an action against it. This is also the default timeout when waiting for an object to appear before continuing the script. You can override individual object wait timeouts in waitForPage() or object.waitFor() by editing their "timeout" properties. Action timeouts cannot be overridden.

share|improve this answer

Do a search on this site for 'wait' - does your tool offer that option? Seems you're clicking before the element us fully loaded/ready so you need a command to wait around until it is.

share|improve this answer
    
The tool is waiting for a page load between each step. –  Yamikuronue Dec 13 '13 at 16:57
1  
I think what he means is that your tool is might be firing the click too soon after the page loads. Given that the element is heavily stylized with jquery I would agree with his hunch; I've seen it plenty of times myself. Are you able to insert a wait in between the page load and the click to verify if this is the case? –  Lucas Schwarz Dec 13 '13 at 17:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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