How to use Application method of FlaUI.Core.Application class

Best FlaUI code snippet using FlaUI.Core.Application.Application

GUITests.cs

Source:GUITests.cs Github

copy

Full Screen

...14 [TestMethod]15 public void HappyAddTest()16 {17 // Set up the automation client and launch the program18 var app = FlaUI.Core.Application.Launch("CalcWhatever.exe");19 using var automation = new UIA3Automation();20 var window = app.GetMainWindow(automation);21 // Find the control elements22 var boxNum1 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum1"))?.AsTextBox();23 var boxNum2 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum2"))?.AsTextBox();24 var btnAdd = window.FindFirstDescendant(cf => cf.ByAutomationId("btnAdd"))?.AsButton();25 var txtResult = window.FindFirstDescendant(cf => cf.ByAutomationId("txtResult"))?.AsTextBox();26 // Set up test variables27 string input1 = "5";28 string input2 = "6";29 string expected = "11";30 var message = $"the sum of {input1} + {input2} should be {expected}";31 // Peforms automation tasks/events32 boxNum1.Enter(input1);33 boxNum2.Enter(input2);34 btnAdd.Click();35 // Pull the result36 var result = txtResult.Text;37 // Closes the app38 app.Close();39 // Verify result40 result.Should().Be(expected, because: message);41 }42 [TestMethod]43 public void SadAddTest()44 {45 // Set up the automation client and launch the program46 var app = FlaUI.Core.Application.Launch("CalcWhatever.exe");47 using var automation = new UIA3Automation();48 var window = app.GetMainWindow(automation);49 // Find the control elements50 var boxNum1 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum1"))?.AsTextBox();51 var boxNum2 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum2"))?.AsTextBox();52 var btnAdd = window.FindFirstDescendant(cf => cf.ByAutomationId("btnAdd"))?.AsButton();53 var txtResult = window.FindFirstDescendant(cf => cf.ByAutomationId("txtResult"))?.AsTextBox();54 // Set up test variables55 var input1 = "5";56 var input2 = "a";57 var expected = "Error";58 var message = "one of the inputs is not a valid integer";59 // Peforms automation tasks/events60 boxNum1.Enter(input1);61 boxNum2.Enter(input2);62 btnAdd.Click();63 // Pull the result64 var result = txtResult.Text;65 // Closes the app66 app.Close();67 // Verify result68 result.Should().Be(expected, because: message);69 }70 }71 [TestClass]72 public class GUITestSub73 {74 [TestMethod]75 public void HappySubTest()76 {77 // Set up the automation client and launch the program78 var app = FlaUI.Core.Application.Launch("CalcWhatever.exe");79 using var automation = new UIA3Automation();80 var window = app.GetMainWindow(automation);81 // Find the control elements82 var boxNum1 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum1"))?.AsTextBox();83 var boxNum2 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum2"))?.AsTextBox();84 var btnSub = window.FindFirstDescendant(cf => cf.ByAutomationId("btnSub"))?.AsButton();85 var txtResult = window.FindFirstDescendant(cf => cf.ByAutomationId("txtResult"))?.AsTextBox();86 // Set up test variables87 string input1 = "5";88 string input2 = "6";89 string expected = "-1";90 var message = $"the difference of {input1} - {input2} should be {expected}";91 // Peforms automation tasks/events92 boxNum1.Enter(input1);93 boxNum2.Enter(input2);94 btnSub.Click();95 // Pull the result96 var result = txtResult.Text;97 // Closes the app98 app.Close();99 // Verify result100 result.Should().Be(expected, because: message);101 }102 [TestMethod]103 public void SadSubTest()104 {105 // Set up the automation client and launch the program106 var app = FlaUI.Core.Application.Launch("CalcWhatever.exe");107 using var automation = new UIA3Automation();108 var window = app.GetMainWindow(automation);109 // Find the control elements110 var boxNum1 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum1"))?.AsTextBox();111 var boxNum2 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum2"))?.AsTextBox();112 var btnSub = window.FindFirstDescendant(cf => cf.ByAutomationId("btnSub"))?.AsButton();113 var txtResult = window.FindFirstDescendant(cf => cf.ByAutomationId("txtResult"))?.AsTextBox();114 // Set up test variables115 var input1 = "5";116 var input2 = "a";117 var expected = "Error";118 var message = "one of the inputs is not a valid integer";119 // Peforms automation tasks/events120 boxNum1.Enter(input1);121 boxNum2.Enter(input2);122 btnSub.Click();123 // Pull the result124 var result = txtResult.Text;125 // Closes the app126 app.Close();127 // Verify result128 result.Should().Be(expected, because: message);129 }130 }131 [TestClass]132 public class GUITestMulti133 {134 [TestMethod]135 public void HappyMultiTest()136 {137 // Set up the automation client and launch the program138 var app = FlaUI.Core.Application.Launch("CalcWhatever.exe");139 using var automation = new UIA3Automation();140 var window = app.GetMainWindow(automation);141 // Find the control elements142 var boxNum1 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum1"))?.AsTextBox();143 var boxNum2 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum2"))?.AsTextBox();144 var btnMulti = window.FindFirstDescendant(cf => cf.ByAutomationId("btnMulti"))?.AsButton();145 var txtResult = window.FindFirstDescendant(cf => cf.ByAutomationId("txtResult"))?.AsTextBox();146 // Set up test variables147 string input1 = "5";148 string input2 = "6";149 string expected = "30";150 var message = $"the product of {input1} - {input2} should be {expected}";151 // Peforms automation tasks/events152 boxNum1.Enter(input1);153 boxNum2.Enter(input2);154 btnMulti.Click();155 // Pull the result156 var result = txtResult.Text;157 // Closes the app158 app.Close();159 // Verify result160 result.Should().Be(expected, because: message);161 }162 [TestMethod]163 public void SadMultiTest()164 {165 // Set up the automation client and launch the program166 var app = FlaUI.Core.Application.Launch("CalcWhatever.exe");167 using var automation = new UIA3Automation();168 var window = app.GetMainWindow(automation);169 // Find the control elements170 var boxNum1 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum1"))?.AsTextBox();171 var boxNum2 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum2"))?.AsTextBox();172 var btnMulti = window.FindFirstDescendant(cf => cf.ByAutomationId("btnMulti"))?.AsButton();173 var txtResult = window.FindFirstDescendant(cf => cf.ByAutomationId("txtResult"))?.AsTextBox();174 // Set up test variables175 var input1 = "5";176 var input2 = "a";177 var expected = "Error";178 var message = "one of the inputs is not a valid integer";179 // Peforms automation tasks/events180 boxNum1.Enter(input1);181 boxNum2.Enter(input2);182 btnMulti.Click();183 // Pull the result184 var result = txtResult.Text;185 // Closes the app186 app.Close();187 // Verify result188 result.Should().Be(expected, because: message);189 }190 }191 [TestClass]192 public class GUITestDivide193 {194 [TestMethod]195 public void HappyDivideTest()196 {197 // Set up the automation client and launch the program198 var app = FlaUI.Core.Application.Launch("CalcWhatever.exe");199 using var automation = new UIA3Automation();200 var window = app.GetMainWindow(automation);201 // Find the control elements202 var boxNum1 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum1"))?.AsTextBox();203 var boxNum2 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum2"))?.AsTextBox();204 var btnDivide = window.FindFirstDescendant(cf => cf.ByAutomationId("btnDivide"))?.AsButton();205 var txtResult = window.FindFirstDescendant(cf => cf.ByAutomationId("txtResult"))?.AsTextBox();206 // Set up test variables207 string input1 = "8";208 string input2 = "4";209 string expected = "2";210 var message = $"the quotient of {input1} / {input2} should be {expected}";211 // Peforms automation tasks/events212 boxNum1.Enter(input1);213 boxNum2.Enter(input2);214 btnDivide.Click();215 // Pull the result216 var result = txtResult.Text;217 // Closes the app218 app.Close();219 // Verify result220 result.Should().Be(expected, because: message);221 }222 public void SadDivideTest()223 {224 // Set up the automation client and launch the program225 var app = FlaUI.Core.Application.Launch("CalcWhatever.exe");226 using var automation = new UIA3Automation();227 var window = app.GetMainWindow(automation);228 // Find the control elements229 var boxNum1 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum1"))?.AsTextBox();230 var boxNum2 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum2"))?.AsTextBox();231 var btnDivide = window.FindFirstDescendant(cf => cf.ByAutomationId("btnDivide"))?.AsButton();232 var txtResult = window.FindFirstDescendant(cf => cf.ByAutomationId("txtResult"))?.AsTextBox();233 // Set up test variables234 string input1 = "8";235 string input2 = "a";236 string expected = "Error";237 var message = $"one of the inputs is not a valid integer";238 // Peforms automation tasks/events239 boxNum1.Enter(input1);240 boxNum2.Enter(input2);241 btnDivide.Click();242 // Pull the result243 var result = txtResult.Text;244 // Closes the app245 app.Close();246 // Verify result247 result.Should().Be(expected, because: message);248 }249 public void DivideByZeroTest()250 {251 // Set up the automation client and launch the program252 var app = FlaUI.Core.Application.Launch("CalcWhatever.exe");253 using var automation = new UIA3Automation();254 var window = app.GetMainWindow(automation);255 // Find the control elements 256 var boxNum1 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum1"))?.AsTextBox(); 257 var boxNum2 = window.FindFirstDescendant(cf => cf.ByAutomationId("txtNum2"))?.AsTextBox();258 var btnDivide = window.FindFirstDescendant(cf => cf.ByAutomationId("btnDivide"))?.AsButton();259 var txtResult = window.FindFirstDescendant(cf => cf.ByAutomationId("txtResult"))?.AsTextBox();260 // Set up test variables261 string input1 = "8";262 string input2 = "0";263 string expected = "Error";264 var message = $"you cannot have a divisor of {input2}";265 // Peforms automation tasks/events266 boxNum1.Enter(input1);...

Full Screen

Full Screen

WordHelper.cs

Source:WordHelper.cs Github

copy

Full Screen

...13 public class WordHelper14 {15 public CaptureImage OpenAndCloseWord()16 {17 using (var application = Application.Launch(@"C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE"))18 {19 application.WaitWhileBusy(TimeSpan.FromSeconds(2));20 using (var automation = new UIA3Automation())21 {22 var screen = application.GetMainWindow(automation);23 var cf = new ConditionFactory(new UIA3PropertyLibrary());24 var button = Retry.Find(() => screen.FindFirstDescendant(cf.ByName("Help")),25 new RetrySettings26 {27 Timeout = TimeSpan.FromSeconds(3),28 Interval = TimeSpan.FromMilliseconds(500)29 }30 );31 application.Close();32 return Capture.MainScreen(); 33 } 34 } 35 }36 public void DisableBottomPannel()37 {38 using (var application = Application.Launch(@"C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE"))39 {40 using (var automation = new UIA3Automation())41 {42 //TODO: Change this into acceptable form43 Thread.Sleep(TimeSpan.FromSeconds(3));44 var screen = application.GetMainWindow(automation);45 var cf = new ConditionFactory(new UIA3PropertyLibrary());46 Retry.Find(() => screen.FindFirstDescendant("AIOStartDocument"),47 new RetrySettings48 {49 Timeout = TimeSpan.FromSeconds(5),50 Interval = TimeSpan.FromMilliseconds(500)51 }52 ).Click();53 screen.FindFirstDescendant(cf.ByName("Collapse the Ribbon")).AsButton().Click();54 }55 application.CloseTimeout = TimeSpan.FromSeconds(2);56 application.Close();57 }58 }59 public bool CheckIfPannelIsAccesible()60 {61 using (var application = Application.Launch(@"C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE"))62 {63 using (var automation = new UIA3Automation())64 {65 //TODO: Change this too66 Thread.Sleep(TimeSpan.FromSeconds(3));67 var screen = application.GetMainWindow(automation);68 var cf = new ConditionFactory(new UIA3PropertyLibrary());69 Retry.Find(() => screen.FindFirstDescendant("AIOStartDocument"),70 new RetrySettings71 {72 Timeout = TimeSpan.FromSeconds(5),73 Interval = TimeSpan.FromMilliseconds(500)74 }75 ).Click();...

Full Screen

Full Screen

ApplicationTests.cs

Source:ApplicationTests.cs Github

copy

Full Screen

...4using NUnit.Framework;5namespace SpikySpamShellTest6{7 [TestFixture]8 public class ApplicationTests9 {10 [Test]11 public void AppLaunchTest()12 {13 using (var app = Application.Launch(@".\SpikySpamShellExtension\bin\Debug\SpikySpamShellExtension.exe"))14 {15 using (var automation = new UIA2Automation())16 {17 var window = app.GetMainWindow(automation);18 Assert.That(window, Is.Not.Null);19 Assert.That(window.Title, Is.Not.Null);20 }21 app.Close();22 }23 }24 [Test]25 public void AddTest()26 {27 using (var app = Application.Launch(@".\SpikySpamShellExtension\bin\Debug\SpikySpamShellExtension.exe"))28 {29 using (var automation = new UIA2Automation())30 {31 var window = app.GetMainWindow(automation);32 var cf = new ConditionFactory(new UIA2PropertyLibrary());33 Assert.DoesNotThrow(() =>34 {35 var btnAdd = window.FindFirstDescendant(cf.ByAutomationId("btnAdd"));36 btnAdd.Click();37 });38 }39 app.Close();40 }41 }...

Full Screen

Full Screen

Application

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using FlaUI.Core;7using FlaUI.Core.AutomationElements;8using FlaUI.Core.AutomationElements.Infrastructure;9using FlaUI.Core.Definitions;10using FlaUI.Core.EventHandlers;11using FlaUI.Core.Input;12using FlaUI.Core.Tools;13using FlaUI.UIA2;14using FlaUI.UIA3;15using System.Windows;16using FlaUI.Core.Conditions;17{18 {19 static void Main(string[] args)20 {21 var application = FlaUI.Core.Application.Launch("notepad.exe");22 var automation = new UIA3Automation();23 var window = application.GetMainWindow(automation);24 var textBox = window.FindFirstDescendant(cf => cf.ByControlType(ControlType.Edit)).AsTextBox();25 textBox.Enter("Hello World");

Full Screen

Full Screen

Application

Using AI Code Generation

copy

Full Screen

1using FlaUI.Core;2using FlaUI.Core.AutomationElements;3using FlaUI.Core.AutomationElements.Infrastructure;4using FlaUI.Core.Definitions;5using FlaUI.Core.Input;6using FlaUI.Core.WindowsAPI;7using FlaUI.UIA3;8using System;9using System.Drawing;10using System.Windows;11using System.Windows.Automation;12using System.Windows.Controls;13using System.Windows.Media;14using System.Windows.Media.Imaging;15using System.Windows.Shapes;16using System.Windows.Threading;17using System.Windows.Input;18using System.Threading;19using System.Diagnostics;20using System.Windows.Automation.Peers;21using System.Windows.Automation.Provider;22using System.Windows.Automation.Text;23using System.Windows.Automation;

Full Screen

Full Screen

Application

Using AI Code Generation

copy

Full Screen

1using FlaUI.Core;2using FlaUI.Core.AutomationElements;3using FlaUI.Core.Conditions;4using FlaUI.Core.Definitions;5using FlaUI.Core.Input;6using FlaUI.Core.WindowsAPI;7using FlaUI.UIA2;8using System;9using System.Collections.Generic;10using System.Linq;11using System.Text;12using System.Threading.Tasks;13{14 {15 static void Main(string[] args)16 {17 var application = FlaUI.Core.Application.Launch(@"C:\Windows\System32\calc.exe");18 var mainWindow = application.GetMainWindow(new UIA2Automation());19 var button = mainWindow.FindFirstDescendant(cf => cf.ByAutomationId("num1Button")).AsButton();20 button.Click();21 var button1 = mainWindow.FindFirstDescendant(cf => cf.ByName("2")).AsButton();22 button1.Click();23 var button2 = mainWindow.FindFirstDescendant(cf => cf.ByName("3")).AsButton();24 button2.Click();25 var button3 = mainWindow.FindFirstDescendant(cf => cf.ByName("4")).AsButton();26 button3.Click();27 var button4 = mainWindow.FindFirstDescendant(cf => cf.ByName("5")).AsButton();28 button4.Click();29 var button5 = mainWindow.FindFirstDescendant(cf => cf.ByName("6")).AsButton();30 button5.Click();31 var button6 = mainWindow.FindFirstDescendant(cf => cf.ByName("7")).AsButton();32 button6.Click();33 var button7 = mainWindow.FindFirstDescendant(cf => cf.ByName("8")).AsButton();34 button7.Click();35 var button8 = mainWindow.FindFirstDescendant(cf => cf.ByName("9")).AsButton();

Full Screen

Full Screen

Application

Using AI Code Generation

copy

Full Screen

1using System;2using FlaUI.Core;3using FlaUI.Core.AutomationElements;4using FlaUI.Core.Definitions;5using FlaUI.Core.Input;6using FlaUI.Core.Tools;7using FlaUI.UIA3;8using System.Diagnostics;9using System.Threading;10{11 {12 static void Main(string[] args)13 {14 var application = FlaUI.Core.Application.Launch(@"C:\Windows\System32\calc.exe");15 var process = application.Process;16 process.WaitForInputIdle();17 var window = application.GetMainWindow(new UIA3Automation());18 var button = window.FindFirstDescendant(cf => cf.ByAutomationId("num1Button"));19 button.AsButton().Click();20 application.Close();21 }22 }23}24using System;25using FlaUI.Core;26using FlaUI.Core.AutomationElements;27using FlaUI.Core.Definitions;28using FlaUI.Core.Input;29using FlaUI.Core.Tools;30using FlaUI.UIA3;31using System.Diagnostics;32using System.Threading;33{34 {35 static void Main(string[] args)36 {37 var application = FlaUI.Core.Application.Launch(@"C:\Windows\System32\calc.exe");38 var process = application.Process;39 process.WaitForInputIdle();40 var window = application.GetMainWindow(new UIA3Automation());41 var button = window.FindFirstDescendant(cf => cf.ByAutomationId("num1Button"));42 button.AsButton().Click();43 application.Close();44 var application2 = FlaUI.Core.Application.Launch(@"C:\Windows\System32\calc.exe");45 var process2 = application2.Process;46 process2.WaitForInputIdle();47 var window2 = application2.GetMainWindow(new UI

Full Screen

Full Screen

Application

Using AI Code Generation

copy

Full Screen

1using System;2using FlaUI.Core;3using FlaUI.Core.AutomationElements;4using FlaUI.Core.Definitions;5using FlaUI.Core.Input;6using FlaUI.Core.Tools;7using FlaUI.UIA3;8using System.Diagnostics;9using System.Threading;10{11 {12 static void Main(string[] args)13 {14 var app = FlaUI.Core.Application.Launch(@"C:\Windows\System32\calc.exe");15 var mainWindow = app.GetMainWindow();16 Thread.Sleep(2000);17 mainWindow.FindFirstDescendant(cf => cf.ByAutomationId("num7Button")).AsButton().Click();18 mainWindow.FindFirstDescendant(cf => cf.ByAutomationId("num9Button")).AsButton().Click();19 mainWindow.FindFirstDescendant(cf => cf.ByAutomationId("plusButton")).AsButton().Click();20 mainWindow.FindFirstDescendant(cf => cf.ByAutomationId("num1Button")).AsButton().Click();21 mainWindow.FindFirstDescendant(cf => cf.ByAutomationId("num5Button")).AsButton().Click();22 mainWindow.FindFirstDescendant(cf => cf.ByAutomationId("equalButton")).AsButton().Click();23 mainWindow.FindFirstDescendant(cf => cf.ByAutomationId("clearButton")).AsButton().Click();24 Thread.Sleep(2000);25 app.Close();26 }27 }28}29using System;30using FlaUI.Core;31using FlaUI.Core.AutomationElements;32using FlaUI.Core.Definitions;33using FlaUI.Core.Input;34using FlaUI.Core.Tools;

Full Screen

Full Screen

Application

Using AI Code Generation

copy

Full Screen

1using System;2using System.Diagnostics;3using FlaUI.Core;4using FlaUI.Core.AutomationElements;5using FlaUI.Core.Definitions;6using FlaUI.Core.Input;7using FlaUI.Core.Tools;8using FlaUI.UIA3;9using System.Threading;10{11 {12 static void Main(string[] args)13 {14 using (var automation = new UIA3Automation())15 {16 var app = FlaUI.Core.Application.Attach(Process.GetProcessesByName("notepad")[0].Id);17 var mainWindow = app.GetMainWindow(automation);18 var textBox = mainWindow.FindFirstDescendant(cf => cf.ByAutomationId("15"));19 var button = mainWindow.FindFirstDescendant(cf => cf.ByAutomationId("14"));20 textBox.AsTextBox().Text = "Hello World";21 button.AsButton().Invoke();22 Thread.Sleep(2000);23 app.Close();24 }25 }26 }27}

Full Screen

Full Screen

Application

Using AI Code Generation

copy

Full Screen

1using FlaUI.Core;2using FlaUI.Core.AutomationElements;3using FlaUI.Core.Definitions;4using FlaUI.Core.Tools;5using System;6using System.Diagnostics;7using System.Linq;8{9 {10 static void Main(string[] args)11 {12 var application = FlaUI.Core.Application.Launch(@"C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE");13 var window = application.GetMainWindow(Automation);14 var button = window.FindFirstDescendant(cf => cf.ByAutomationId("FileTab")).AsButton();15 button.Click();16 var button1 = window.FindFirstDescendant(cf => cf.ByAutomationId("FileNew")).AsButton();17 button1.Click();18 var textbox = window.FindFirstDescendant(cf => cf.ByAutomationId("1001")).AsTextBox();19 textbox.Text = "Hello";20 var button2 = window.FindFirstDescendant(cf => cf.ByAutomationId("1")).AsButton();21 button2.Click();22 var button3 = window.FindFirstDescendant(cf => cf.ByAutomationId("2")).AsButton();23 button3.Click();24 var button4 = window.FindFirstDescendant(cf => cf.ByAutomationId("3")).AsButton();25 button4.Click();26 var button5 = window.FindFirstDescendant(cf => cf.ByAutomationId("4")).AsButton();27 button5.Click();28 var button6 = window.FindFirstDescendant(cf => cf.ByAutomationId("FileSaveAs")).AsButton();29 button6.Click();30 var textbox1 = window.FindFirstDescendant(cf => cf.ByAutomationId("1001")).AsTextBox();31 textbox1.Text = "C:\\Users\\Public\\Documents\\Hello.docx";32 var button7 = window.FindFirstDescendant(cf => cf.ByAutomationId("1")).AsButton();33 button7.Click();34 var button8 = window.FindFirstDescendant(cf => cf.ByAutomationId("FileExit")).AsButton();35 button8.Click();36 application.Close();37 }38 private static AutomationBase Automation => new UIA3Automation();39 }40}

Full Screen

Full Screen

Application

Using AI Code Generation

copy

Full Screen

1using FlaUI.Core;2using FlaUI.Core.AutomationElements;3using FlaUI.Core.Definitions;4using FlaUI.Core.Input;5using FlaUI.Core.WindowsAPI;6using FlaUI.UIA3;7using System;8using System.Diagnostics;9using System.Threading;10using System.Windows.Automation;11{12 {13 static void Main(string[] args)14 {15 var application = FlaUI.Core.Application.Launch(@"C:\Windows\System32\calc.exe");16 var window = application.GetMainWindow(Automation);17 var button = window.FindFirstDescendant(cf => cf.ByAutomationId("num1Button"));18 button.Click();19 var button2 = window.FindFirstDescendant(cf => cf.ByAutomationId("num1Button"));20 button2.Click();21 var button3 = window.FindFirstDescendant(cf => cf.ByAutomationId("plusButton"));22 button3.Click();23 var button4 = window.FindFirstDescendant(cf => cf.ByAutomationId("num1Button"));24 button4.Click();25 var button5 = window.FindFirstDescendant(cf => cf.ByAutomationId("equalButton"));26 button5.Click();27 var button6 = window.FindFirstDescendant(cf => cf.ByAutomationId("clearButton"));28 button6.Click();29 var button7 = window.FindFirstDescendant(cf => cf.ByAutomationId("num1Button"));30 button7.Click();31 var button8 = window.FindFirstDescendant(cf => cf.ByAutomationId("num1Button"));32 button8.Click();33 var button9 = window.FindFirstDescendant(cf => cf.ByAutomationId("minusButton"));34 button9.Click();35 var button10 = window.FindFirstDescendant(cf => cf.ByAutomationId("num1Button"));

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run FlaUI automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful