You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm beginner with C# and White, and I'm trying to automate a very stupid action => Click on the "New" button in Notepad++.
Challenge, I'm building a DLL => I use that DLL in Automation Anywhere (Metabot).
Here is my DLL code :
using System;
using System.Diagnostics;
using System.Windows;
using TestStack.White;
using TestStack.White.WindowsAPI;
using TestStack.White.UIItems;
using TestStack.White.UIItems.Finders;
I'm trying to make the ClickButton2 function working.
Actually, I provide "notepad++" as value for procName, applicLaunch, applicAttach, "new 5 - Notepad++" as value for getWin and "New" for automationId.
The script is failing when it comes to "TestStack.White.UIItems.Button button = window.Get<TestStack.White.UIItems.Button>(TestStack.White.UIItems.Finders.SearchCriteria.ByText(automationId));".
Could one of you help me with that ? I'm sure for you it's gonna be easy to solve ;-)
Thanks!
Augustin
The text was updated successfully, but these errors were encountered:
Dear,
I'm beginner with C# and White, and I'm trying to automate a very stupid action => Click on the "New" button in Notepad++.
Challenge, I'm building a DLL => I use that DLL in Automation Anywhere (Metabot).
Here is my DLL code :
using System;
using System.Diagnostics;
using System.Windows;
using TestStack.White;
using TestStack.White.WindowsAPI;
using TestStack.White.UIItems;
using TestStack.White.UIItems.Finders;
namespace MyAADLL
{
public class MyAAClass
{
public static void ClickButton2(string procName, string applicLaunch, string applicAttach, string getWin, string automationId)
{
Application application;
Process[] processes = Process.GetProcessesByName(@procname);
if (processes.Length == 0)
{
application = Application.Launch(@applicLaunch);
}
else
{
application = Application.Attach(@applicAttach);
}
TestStack.White.UIItems.WindowItems.Window window = application.GetWindow(getWin);
TestStack.White.UIItems.Button button = window.Get<TestStack.White.UIItems.Button>(TestStack.White.UIItems.Finders.SearchCriteria.ByText(automationId));
button.Click();
}
}
}
I'm trying to make the ClickButton2 function working.
Actually, I provide "notepad++" as value for procName, applicLaunch, applicAttach, "new 5 - Notepad++" as value for getWin and "New" for automationId.
The script is failing when it comes to "TestStack.White.UIItems.Button button = window.Get<TestStack.White.UIItems.Button>(TestStack.White.UIItems.Finders.SearchCriteria.ByText(automationId));".
Could one of you help me with that ? I'm sure for you it's gonna be easy to solve ;-)
Thanks!
Augustin
The text was updated successfully, but these errors were encountered: