Forum Discussion

littlebear's avatar
littlebear
Contributor
5 hours ago

Improve test performance message creating blank selectors

Hello,

In my test, I am manipulating my selector for an object using variables. It only has one selector. For example:

//div[@role='main']/div[%ProjectDiv%]

Because of this, I am frequently getting Log messages (previously they were warnings) telling me to improve my performance by making a given selector, that I don't currently have, the first selector for an object. Like this selector, for instance:

//div[@role='main']/div[1]

For curiosity's sake, I will "improve my performance", and when I do so my objects selectors look like this: 

This is quite weird, and it will certainly not help my test's performance. Does anyone know of a way to either remove these messages or help Testcomplete recognize the variable selector is best once and for all?

Thanks you,

  • Hello,

    Long ago, I reported to SmartBear this "improve my performance" feature resulting in an "Empty" entry, and gave up on using it.

    Also I learned to ignore the log messages of "improve my performance" as they do not make sense since my constructed XPath is a simple one.

    I have been using string variables %Button% = 'Save', I did not try integer variables %ProjectDiv% = 1, could that make a difference?

    To minimize these occurrences, keep in mind that NameMapping Aliases have parent child multi level structure, where Mapped objects are page and a flat out list of nodes. If your Mapped objects also consist of parent child multi level structure, you will get such performance message. 

    Hope this is helpful.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    If it's not hampering your automation, then it's probably best to ignore it.