1

I have one web page which has HTML, javascript and iFrames. I am extracting attributes of HTML tags by below code for reference:

Dictionary<string, object> attributes = new Dictionary<string, object>();
try
{
   IJavaScriptExecutor javascriptDriver = (IJavaScriptExecutor)objBrowser;
   attributes = javascriptDriver.ExecuteScript("
      var items = {};   
      for (index = 0; index < arguments[0].attributes.length; ++index) { 
           items[arguments[0].attributes[index].name] = arguments[0].attributes[index].value }; 
      return items;", 
   objWebElement) as Dictionary<string, object>;
}

but I am getting error in attributes like mentioned in Title. Need help and support if anyone can help me on the same.

Evgeniy Chiruk
  • 358
  • 1
  • 10

0 Answers0