Question

Some background: For doing UI automation scripting, I look for object id,

for eg, <input id="PrimaryAddress_StreetName" maxlength="20" name="PrimaryAddress.StreetName" type="text" value="" />

to locate textbox and perform any action through automated scripts.

Similarly, the application I am testing is developed in ASP.NET and have some validation messages and popover messages implemented through bootstrap and JQuery JS file.

Since they are created on the fly there is no way our developer thinks they can give an ID to those objects. Which means, I see those bootstrap messages but when I do view source code, I don't corresponding html tag. When I asked the developer, they said it's driven by src Javascript files.

Sample JS file code,

if (propertyTypeId == 2) {
  var content = 'Note:  You cannot have more than 8 rental units in total and no more than 4 rental units you own in any one structure.';
  $(this).popover({ title: 'Rental Note', content: content, trigger: 'manual' });
  $(this).popover('show');

I was wondering if there is a way that we can set an ID to those objects so that my Automation tool (TestComplete) can detect that and help me in writing the automated scripts to test the application.

Was it helpful?

Solution

I think that the best solution in your case is mapping these objects manually by their text or other properties that can identify object uniquely. Use the Name Mapping functionality of TestComplete along with its Required Children and Extended Find features.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top