Forum Discussion

radu's avatar
radu
Occasional Contributor
6 years ago

finding object in human-written html files

Dear all,

 

I have a very simple html (see the attached code) and I don't know how to make TestComplete see the radio buttons. I've tried looking with DisplayObjectSpy, but I can't see anything useful to point me to the radio buttons.

 

In principle, I would need to check which of these two radio buttons is checked.

 

I'm using TC12.42.3048.7 on x64 and for web testing I'm using Tree model.

 

What I get in ObjectBrowser:

 

The code:

 

<!DOCTYPE html>
<html>
<head>
<title>blablabla</title>
</head>
<body>

<form action="testResultAcquire.html">
  <fieldset>
    <legend>Test result:</legend>
    <form>
      <input type="radio" name="testResult" value="passed"> Test passed<br>
      <input type="radio" name="testResult" value="failed"> Test failed<br>
    </form>     
  </fieldset>
</form>
</body>
</html>

Thank you!
R

5 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Try recording a test where you click the buttons and see what TC uses to reference them.

    • radu's avatar
      radu
      Occasional Contributor

      Hi Marsha!

       

      I've tried your approach, but unfortunately I didn't get anything usefull (I've done some clicks on the radio buttons):

       

      function Test1()
      {
        var chrome_RenderWidgetHostHWND;
        chrome_RenderWidgetHostHWND = Aliases.browser.BrowserWindow.Chrome_RenderWidgetHostHWND;
        chrome_RenderWidgetHostHWND.HScroll.Pos = 0;
        chrome_RenderWidgetHostHWND.VScroll.Pos = 0;
        chrome_RenderWidgetHostHWND.Click(88, 45);
        chrome_RenderWidgetHostHWND.Click(37, 42);
        chrome_RenderWidgetHostHWND.Click(36, 66);
      }

      Thank you!

      R