Forum Discussion

royd's avatar
royd
Regular Contributor
9 years ago

How to edit dynamic object link (with wild card), of a Mapped Object? Stuck at clicking a button!

Hi

 

First off, I am very new to Automation as well as scripting (jsctipt).

 

I am working on a test that involves generating a printable result of a search result. Yesterday I completed the general workflow. Today I was planning to add some checkpoints to finalize the script.

 

Before starting, I ran the script one more time to make sure nothing was broken. Sure enough, got stuck at the point it is supposed to click "Printable Results" button.

 

Looking at the "buttonPrintableResults", found out it is mapped as:

Sys.Browser("iexplore").Page("https://amigo.imedconsent.com/SRC/Search.aspx?ReportID=f9ac8102-bfd2-447c-a54c-0e2e136c7389&TabID=dpef3f").Form("aspnetForm").Table(0).Cell(0, 1).Panel("mainBody").Panel("divPaneContainer").Panel(0).Button("lnkLaunchPrintable")

When I checked with ObjectSpy today, I got:

Sys.Browser("iexplore").Page("https://amigo.imedconsent.com/SRC/Search.aspx?ReportID=f9ac8102-bfd2-447c-a54c-0e2e136c7389&TabID=dppw4t").Form("aspnetForm").Table(0).Cell(0, 1).Panel("mainBody").Panel("divPaneContainer").Panel(0).Button("lnkLaunchPrintable")

Is there a way to edit the Mapped Object "buttonPrintableResults" to replace

... a54c-0e2e136c7389&TabID=dpef3f

to

... a54c-0e2e136c7389&TabID=*

 ?

 

Here is the snippets from my script -

....

//last name of another patient Aliases.browser.pagePatientIdave80719204445Searc.formAspnetform.textboxTxtsearchitem.SetText("Doe");

 

//run search

Aliases.browser.pagePatientIdave80719204445Searc.formAspnetform.submitbuttonRunSearch.ClickButton();

//click printable results
Aliases.browser.pagePatientIdave80719204445Searc.formAspnetform.buttonPrintableResults.ClickButton();

....

 

Is there any other way it can be addressed?

 

Thanks for help in advance.

    • royd's avatar
      royd
      Regular Contributor

      In our new build, the feature was broken. Have to wait till the next build before I can try your suggestion. I will post here once I can verify.

       

      Thanks

       

      Dave

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        A little helpful hint for you as well ....

         

        Your Alias names are horrible.

         

        The whole point of using an Alias is to make it more readable than the long name the object store uses.

         

        Personally, I would change:

         

        Aliases.browser.pagePatientIdave80719204445Searc.formAspnetform.textboxTxtsearchitem

         

        To something more like:

         

        Aliases.browser.PatientPage.Form.SearchBox

         

        Which I think you'll agree, is a lot easier on the eye.

  • royd's avatar
    royd
    Regular Contributor

    I would like to thank both Marsha_R and Colin_McCrae for their valuable suggestion. You guys are great help! :)