Inconsistent QTP behavior when selecting a radio button from a radio group
We have QTP scripts that select a radio button from a web table. The scripts select the correct radio button on some machines (most Windows 7 machines but not all of them) and select incorrect radio buttons on others (most Windows XP machines but not all of them). We have also seen inconsistent behavior on the same machine on different days.
Does anyone have an idea what could be causing this issue and how to resolve it?
Thanks. This is the code we have in place. However, on some machines QTP selects radio button #n +1 instead of #n while it selects rafdio button #n on other machines.
What selectors are you using? I know on browsers IE9 and later, there's an extra <tbody> that's inserted into tables. On older browsers, the <tbody> isn't created for tables. So if you have say a field set group that's done using tables instead of <ul>/<li> tags, things selected by index might be shifted.
If you throw some code in here for us to pick apart we may get to a solution faster. It would also eliminate duplication of effort so vinodfg wouldn't have wasted time replicating your code.
When differences in presentation occur I have found it is down to how the information is presented by the delivery mechanism. This may present as a code defect, but not a functional one.
I would cater for the random occurrence with an IF statement that would deliver the conditional result based on the presented page. The IF statement should clarify that the radio button to select is the one you expect to see before you select it. You should be able to define the correct radio button using the object properties.
While I have been working for Businesses that are Vendor partners with HP, IBM and Microsoft, my opinions and advice is my own.
The solutions provided are either sourced from my own scripting libraries or from a quick Google Search.