We have some existing keyword tests with scripts where we use methods EvaluateXpath, FindChildByXpath etc.
Now we are running the same keyword tests through the Run Remote browser utility to perform crossbrowser tests across browsers/devices. The test seem to be failing at steps where EvaluateXpath, FindChildByXpath are used. What is the workaround to make the existing scripts compatible with cross browser tests through Run Remote Browser?
Any help will be greatly appreciated.
Solved! Go to Solution.
Just o sum-up: as @hkim5 already wrote, new cross-platform mode introduced in TC 14.40 is not compatible with old test code and works only for the new projects that use .FindElement() and .WaitElement() page methods only.
The reason is that cross-platform mode runs Selenium under the hood and two mentioned methods are the only ones that are translated to Selenium calls during runtime.
All other methods provided by TestComplete are not translated to Selenium calls and thus cannot be used for cross-platform testing.
you will need to create a new project and enable the scalable web tests setting to use the run remote browser step. the reason being that the way objects are identified are completely different (the older, existing tests will use the traditional name mapping with object properties, whereas the new scalable web tests that work with the run remote browser step will use the .findelement method to identify each of the objects that you are interacting with). with that said, to answer your question, there is no way to make your old tests (that use the old name mapping) work with the run remote browser step
Thanks Kim, for your reply.
We are not using any name mapping objects in our scripts. Scripts are failing at the EvaluateXpath step (refer image attached, highlighted step). These scripts do work with virtual browsers, desktop local browsers, only failing with the Run Remote browser utility.
ok, one last really obvious question that I have to ask is, have you purchased a Device Cloud add on for your TestComplete instance?
Not yet purchased. Evaluation with trial version is being carried out now. So the device cloud is enabled but under a trial license.
ok, thats probably not the issue then. If you could then share the test logs with the details of the step where it failed, would be more helpful in debugging this error (especially if the function passes on local browers, and only fails when we use the run remote browser added in.)
could you try replacing the EvaluateXpath with the findElement method instead? https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/page/findelement-meth...
syntax should be similar
@hkim5 Tried with FindElement and it works but it does not serve the purpose here. What I am looking for is the collection of objects having same XPath, which EvaluateXpath's array length property can provide.
With FindElement, it is returning the first occurrence of this object so no way to know how many similar objects exists in the page.
Is there a FindAllElements?
Of, you could use FindAllChildren? That's a bit more of a conventional find that will return an array of objects with similar properties.