Forum Discussion

emma_cheeseman's avatar
emma_cheeseman
Established Member
4 years ago
Solved

Aliase.page assining a Variable

I am trying to do an edit on an object and select a value from the drop down.  When I select the object its being created with the client number. I want to assign a Variable so I can re-use the same code looping through different clients. I have tried but keep getting object not found. I am new to test complete so maybe missing a very simple step. I want to have the 664006 as a variable. Java

 

  let page = Aliases.browser.page664006
  let form = page.formEditclient;
  form.select.ClickItem("No");
  form.select2.ClickItem("Yes");
  page.buttonSave.ClickButton();

  • sonya_m's avatar
    sonya_m
    4 years ago

    Thank you for trying to help here, Alex!

     

    emma_cheeseman I see that you opened a support case and got a reply there. Let me post it to the Community:

     

    >>

    If I understand correctly, when you open a page with the specific client ID, the page URL is modified so it contains this ID.
     
    This could prevent tests from working indeed when a page is mapped in Name Mapping by the URL with this ID. However, this variable part of the URL can be just ignored. For this, you can use the wildcard (see Using Wildcards [https://support.smartbear.com/testcomplete/docs/reference/misc/using-wildcards.html]).

    <<

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    I have tried but keep getting object not found.

    What line from your code sample throws this error?

     

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Thank you for trying to help here, Alex!

       

      emma_cheeseman I see that you opened a support case and got a reply there. Let me post it to the Community:

       

      >>

      If I understand correctly, when you open a page with the specific client ID, the page URL is modified so it contains this ID.
       
      This could prevent tests from working indeed when a page is mapped in Name Mapping by the URL with this ID. However, this variable part of the URL can be just ignored. For this, you can use the wildcard (see Using Wildcards [https://support.smartbear.com/testcomplete/docs/reference/misc/using-wildcards.html]).

      <<