We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
I solved the problem now. I have had taken the whole hudge XPath, and there were some issues with it. Now I used an extension and got a shorter XPath and now it is working.
Thank you for your help :)
lambada wrote:
I solved the problem now. I have had taken the whole hudge XPath, and there were some issues with it. Now I used an extension and got a shorter XPath and now it is working.
Thank you for your help :)
This is the drawback for using XPath for finding objects. Many times what is returned by an XPath find is not a UI object recognized by TestComplete and, therefore, will not have either the Keys or SetText method. This will generate an error, then, if you try and use one of those methods with what is returned.
Additionally... XPath searching scans the whole DOM which takes time. TestComplete's NameMapping feature is the preferred and recommended way for object identification.
Thank you very much!
Could you plese make a very short example in my case with the NameMapping feature?
Since I don't know your application, everything is going to be in generic terms.
function Login(userName, password){
try{
Sys.Browser('chrome').Run('http://myserver.myapp/')'
var myPage = Aliases.browser.WaitAliasChild('pageLogin', -1);
if (!myPage.Exists){
throw Error('Login page did not load in time');
}
myPage.userName.SetText(userName);
myPage.password.Keys(password);
myPage.LoginButton.ClickButton();
var myPage = Aliases.browser.WaitAliasChild('landingPage', -1);
if (!myPage.Exists){
throw Error('Primary landing page after login did not load in time');
}
}
}