Forum Discussion

nedbacan's avatar
nedbacan
Frequent Contributor
5 years ago
Solved

URL Object not found

 

The page URL name changes dynamically don't know why,  I followed the documents and videos regarding dynamic pages and still cannot get the script to run everytime. 

 

This is one of the Objects that keep changing Aliases.browser.pageImagenet2.buttonNewPatient, it keeps adding a different number, or no number.  Is there a way to place a wildcard in replace of the number? Or is this not the problem, is the URL name?  See screen shot.   BTW, I tried placing an asterisks in replace of the \Login shown the URL, but that did not work.

 

So in the Mapping, the PageImagenet2 is not changeable that I can add a wildcard or move up to a higher level.

 

I am using TestComplete version 14.30.374.  The video shows it different than what the TC allows me.

 

Can you provide screenshots or a video of your own to showing what I am doing wrong?

 

In the attachment, you will notice PageImagenet and PageImagenet2, this is where the object gets changed. 

 

I noticed PageImagenet2 is browsing to http://localhost/IMAGEnet/Login, which cannot find it because it is expecting patient page http://localhost/IMAGEnet/Patient,  the software app under test changes  the URL dynamically so the TestComplete looses the connection how it was recorded from the beginning.

 

Need big help.  Stuck.  

  • the reason that you have two mapped objects with the names pageImagenet and pageImagenet2 respectively is because (as you pointed out) they have two distinct URL's that they are getting mapped by.

     

    This intuitively makes sense because you can imagine, two different web pages are two different objects in their own right. 

     

    If there is a third page, for example, where the URL is something like "http://localhost/IMAGEnet/Doctor" then TestComplete will by default, map this new object (probably s pageImagenet3) with identification properties of ObjectType Page and URL of that third "IMAGEnet/Doctor" url. 

     

    If what you are saying is that all of the child elements underneath each of those URL's remain the same (so in your case, the two pages http://localhost/IMAGEnet/Login and http://localhost/IMAGEnet/Patient) and that the button new patient persists throughout both of those pages, then by all means, you can rightclick on the object identification properties of both of those top level pages (so in your case pageImagenet and pageImagenet2) and within the URL property, replace the Login with * for pageImagenet and Patient wtih * for pageImagenet2. However, this is probably not the case.

     

    so when you say:

    "I noticed PageImagenet2 is browsing to http://localhost/IMAGEnet/Login, which cannot find it because it is expecting patient page http://localhost/IMAGEnet/Patient,  the software app under test changes  the URL dynamically so the TestComplete looses the connection how it was recorded from the beginning."

    -- to troubleshoot this, you should look at the step above the object method that calls on pageImagenet2. there is probably a run browser or navigate browser step; that is, pageImagenet2 in itself does not perform a run/navigate browser step, and there is a separate step for that) - this is probably where the error is occuring, causing you to believe that the name mapping is the problem. Otherwise, judging by your screenshots, I'd say there actually no problem with the dafault name mapping at all right now. 

1 Reply

  • the reason that you have two mapped objects with the names pageImagenet and pageImagenet2 respectively is because (as you pointed out) they have two distinct URL's that they are getting mapped by.

     

    This intuitively makes sense because you can imagine, two different web pages are two different objects in their own right. 

     

    If there is a third page, for example, where the URL is something like "http://localhost/IMAGEnet/Doctor" then TestComplete will by default, map this new object (probably s pageImagenet3) with identification properties of ObjectType Page and URL of that third "IMAGEnet/Doctor" url. 

     

    If what you are saying is that all of the child elements underneath each of those URL's remain the same (so in your case, the two pages http://localhost/IMAGEnet/Login and http://localhost/IMAGEnet/Patient) and that the button new patient persists throughout both of those pages, then by all means, you can rightclick on the object identification properties of both of those top level pages (so in your case pageImagenet and pageImagenet2) and within the URL property, replace the Login with * for pageImagenet and Patient wtih * for pageImagenet2. However, this is probably not the case.

     

    so when you say:

    "I noticed PageImagenet2 is browsing to http://localhost/IMAGEnet/Login, which cannot find it because it is expecting patient page http://localhost/IMAGEnet/Patient,  the software app under test changes  the URL dynamically so the TestComplete looses the connection how it was recorded from the beginning."

    -- to troubleshoot this, you should look at the step above the object method that calls on pageImagenet2. there is probably a run browser or navigate browser step; that is, pageImagenet2 in itself does not perform a run/navigate browser step, and there is a separate step for that) - this is probably where the error is occuring, causing you to believe that the name mapping is the problem. Otherwise, judging by your screenshots, I'd say there actually no problem with the dafault name mapping at all right now.