Forum Discussion

rushikesh's avatar
rushikesh
Contributor
8 years ago

How to use an argument while calling object using image repository.

Below is my code.

 


function Test1()
{

       ImageRepository.IDRowMillInch.HoleFeaCondCopy.Click()
}

 

when executed, a click is performed on HoleFeaCondCopy object present in Image Repository.

 

How to use the above function for other objects present in Image Repository as well.

 

 

 

Below code I am using .

 

function Test1(Row)
{

       ImageRepository.IDRowMillInch.Row.Click()
} 

 

function Run()

{

    Test1("HoleFeaCondCopy")

}

 

 

Following error is observed when call function run.

"Cannot read property 'Click' of undefined"

 

 

 

 

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    If you're using JScript or JavaScript, a trick you can use is to use the [] notation instead of dot notation for objects to get around this.  So, change your code to the following:

    function Test1(Row)
    {

           ImageRepository.IDRowMillInch[Row].Click()
    } 

     

    function Run()

    {

        Test1("HoleFeaCondCopy")

    }