Forum Discussion

stroev's avatar
stroev
Occasional Contributor
9 years ago

How to simulate check-box to be enabled?

Hello guys,

 

I am trying to click-on a check-box which is created during scenario verification.

Here is the flow:

During a recording scenario, I add ann item which generates a row in the html and a check-box with some ID.

I click on the check-box t.a pop-up displays, which confirmation sends an e-mail- but now action is recorded in the recorder when the check-box is selected:

 

I extract the ID of the check-box and save it into a variable.

 

So when I try to verify the scenario, another row is added in thr html with different ID. I call the variable again for the new added ID of the check-box, but the send e-mail seems to be for the firstly used /recorded check-box.

 

Could someone propose any ideas on how could I simulate a clicking/selecting the appropriate check-box?

 

Kind Regards,

 

Stoyan.

 

 

  • HI all,

     

    The problem was solved by using data corelation and data selectors.

  • stroev's avatar
    stroev
    Occasional Contributor

    HI all,

     

    The problem was solved by using data corelation and data selectors.

  • Hi Stoyan,

     

    From what I understood, you create a new row with a checkbox, then in the next step you want to verify the newly created checkbox. In the next step you want to verify / click the created checkbox? Now instead of clicking the new checkbox, the script keeps verifying the old one.

     

    Firstly, have two code blocks for step 1 (writing / creating the new row / checkbox) and step 2 (verifying the new checkbox). For the second code block (step 2), you might want to parameterize the 'new' checkbox's name map to add the ObjectIdentifier / ID property of the new object. The reason it keeps opening the old checkbox one is TestComplete does not have the newly created object in its name mapping repository. You will have to add it manually. I hope that makes sense.

     

    Cheers!

     

    Ali