Forum Discussion

eykxas's avatar
eykxas
Regular Contributor
6 days ago

Bypassing TC engine

Hi everyone !

Since Smartbear still doesn't fix the custom web element detection issue, I'm trying to bypass TC's internal engine.

I would like to use the native method of javascript to evaluate xpath expression. https://developer.mozilla.org/en-US/docs/Web/API/Document/evaluate

I have access to the method in TC, but I can't figure out which parameter to pass.

Do you have any idea how to use this?

Thx

  • In TC, if the Object is being returned, then you will need to know the objects you need to access via dot notation. TC might not show you the properties when you press the dot key, because of the JavaScript engine being used.

    • eykxas's avatar
      eykxas
      Regular Contributor

      Hi ! I saw this thread, (I always do research before posting here).
      Unfortunately, TC doesn't recognize these parameters and I get an error : XPathResult is not defined.

      • rraghvani's avatar
        rraghvani
        Champion Level 3

        You might have to declare the Object like this, to be passed into the evaluate method.

        const ages = { alice: 18, bob: 27 };
        Log.Message(ages.alice);
        Log.Message(ages.bob)
            
        const me = new Object(ages);
        Log.Message(me.alice);
        Log.Message(me.bob);
        Log.Message(me);