Forum Discussion

lokithorshield's avatar
lokithorshield
Contributor
9 years ago

How to get Objects using getElementsByClassName

Hello, 

var some_var = Sys.Browser("*").Page("*").contentDocument.getElementsByClassName("xxx");
var someoTher_Var = some_var.item(1)
Log.Message(some_var.FullName);

 

I am able to see get element by class name as 8 objects - length 8?. But how to access the object? convert to Array using 'toArray' not working. How do I actually get the first object

 

Thanks,

Mahesh

2 Replies

    • lokithorshield's avatar
      lokithorshield
      Contributor

      Hi Tanya,

      I guess this is not a CSS element. It comes under SVG node, so the HTML nodes below does not get recognized. Either Content document find works or switching the Object model - Tree to DOM works. So instead of dynamically changing the model, am using the above. CSS/Xpath etc is not working.

       

      Thanks,

      Mahesh