I am trying to get a sample copy of the Winium.Cruciatus code working.
Code:
using System.Windows.Automation;
using Winium.Cruciatus.Core;
using Winium.Cruciatus.Extensions;
namespace CruciatusCalcu
{
public class Program
{
private static void Main(string[] args)
{
var calc = new Winium.Cruciatus.Application("C:/windows/system32/calc.exe");
calc.Start();
var winFinder = By.Name("Calculator").AndType(ControlType.Window);
var win = Winium.Cruciatus.CruciatusFactory.Root.FindElement(winFinder);
var menu = win.FindElementByUid("MenuBar").ToMenu();
menu.SelectItem("View$Scientific");
win.FindElementByUid("132").Click(); // 2
win.FindElementByUid("93").Click(); // +
win.FindElementByUid("134").Click(); // 4
win.FindElementByUid("97").Click(); // ^
win.FindElementByUid("138").Click(); // 8
win.FindElementByUid("121").Click(); // =
// calc.Close();
}
}
}
I am getting an Exception Unhandled Error Message: Winium.Cruciatus.Exceptions.CruciatusException: NOT SELECT ITEM
In the error window I see:
[15:41:55] [Info] Click on 'type: ControlType.MenuItem, uid: Item 1, name: View'
element at (1821, 283) ClickablePoint
[15:42:05] [Info] Element 'Name: Scientific' not found
[15:42:05] [Error] Item 'View$Scientific' not found. Select item failed.
Aucun commentaire:
Enregistrer un commentaire