<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unable to call a static method in custom code in Blueprism code stage (C#) in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Unable-to-call-a-static-method-in-custom-code-in-Blueprism-code/m-p/73187#M25792</link>
    <description>Hello,

I was trying to wrtite a custom code in C# to identify the notification icons and perform certain actions on the same.

&amp;nbsp;

we have the following method defined

&amp;nbsp;public static AutomationElement Find(this AutomationElement root, string name)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return root.FindFirst(

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeScope.Descendants,

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new PropertyCondition(AutomationElement.NameProperty, name));

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

var myFind = AutomationElement.RootElement.Find("MyString");

&amp;nbsp;

and we have a call to this method as below:

var myFind = AutomationElement.RootElement.Find("MyString");

&amp;nbsp;

This code is working perfectly fine in Visual studio.

&amp;nbsp;

But Blue Prism throws following error

'System.Windows.Automation.AutomationElement' does not contain a definition for 'Find' and no extension method 'Find' accepting a first argument of type 'System.Windows.Automation.AutomationElement' could be found.

I have imported all the necessary dlls. But the issue still persists.

Appreciate any help on the above.

&amp;nbsp;

Regards,

Hemanth

&amp;nbsp;</description>
    <pubDate>Thu, 29 Nov 2018 13:10:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-11-29T13:10:00Z</dc:date>
    <item>
      <title>Unable to call a static method in custom code in Blueprism code stage (C#)</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Unable-to-call-a-static-method-in-custom-code-in-Blueprism-code/m-p/73187#M25792</link>
      <description>Hello,

I was trying to wrtite a custom code in C# to identify the notification icons and perform certain actions on the same.

&amp;nbsp;

we have the following method defined

&amp;nbsp;public static AutomationElement Find(this AutomationElement root, string name)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return root.FindFirst(

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeScope.Descendants,

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new PropertyCondition(AutomationElement.NameProperty, name));

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

var myFind = AutomationElement.RootElement.Find("MyString");

&amp;nbsp;

and we have a call to this method as below:

var myFind = AutomationElement.RootElement.Find("MyString");

&amp;nbsp;

This code is working perfectly fine in Visual studio.

&amp;nbsp;

But Blue Prism throws following error

'System.Windows.Automation.AutomationElement' does not contain a definition for 'Find' and no extension method 'Find' accepting a first argument of type 'System.Windows.Automation.AutomationElement' could be found.

I have imported all the necessary dlls. But the issue still persists.

Appreciate any help on the above.

&amp;nbsp;

Regards,

Hemanth

&amp;nbsp;</description>
      <pubDate>Thu, 29 Nov 2018 13:10:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Unable-to-call-a-static-method-in-custom-code-in-Blueprism-code/m-p/73187#M25792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-29T13:10:00Z</dc:date>
    </item>
  </channel>
</rss>

