Forum Discussion

rrobinson's avatar
rrobinson
New Contributor
2 years ago

Navigate to a page passing in a GUID as an MVC parameter to the controller

Hello! This is my first post so forgive me if my terminology is noobish!

I am using the record feature using the KeywordTests so far - and there is an issue navigating to a page that is passing a GUID string in my URL as shown in the image below. We are using MVC in a C# web project and are passing in the ID into the new and edit pages so the code can get the current user's GUID from login in order to secure it is him and not someone hacking in etc.... 

 

When navigating to such a page it always comes back from timing out, as an error loading/finding the page. How do I navigate to pages that have a long (33 chars I think) GUID? I am guessing that the string may be getting truncated and does not match maybe - or something like that.

 

Thanks for any help! Remember I am a noob so please answer so a baby user like me can understand how to fix this!!!  Thank you!

  • When you use record and playback, TC will sometimes fail to find the UI object. You need to identify the UI Object, that is, to instruct TC on how to locate the object using properties, in your tested application. See Object Identification.

     

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    That's just the name of the UI object which you have highlighted. You need to check the properties of that UI object, which TC uses to identify the control.

    • rrobinson's avatar
      rrobinson
      New Contributor

      That is good and seems simple... as a 3-4 day-old TestComplete dude - can you provide a solution to overcome these 3 lines as an example - I believe they are all generally the same solution. Would I need to replace each line with some simple script call to 'check' an object as you said? I am using JavaScript being a C# MVC dev person. Thoughts? The script has 3 lines select that fail shown below - and the resulting log snippet is below that.

      log:

      Thoughts?

      Thanks a TON!

      Russ

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    When you use record and playback, TC will sometimes fail to find the UI object. You need to identify the UI Object, that is, to instruct TC on how to locate the object using properties, in your tested application. See Object Identification.