Hi all,
I am developing a console application using C# to automate Print Job for a bulk of documents. Below I am mentioning my plan for developing and my approach.
Algorithm:
1)Fetch list of documents.
2)Process the document list one by one.
a)Launch the Application.
b)Wait till the application launched perfectly.
c)Fire the Print Job.
d)Wait for Print dialog appear.
e)Fire "ENTER" key press event.
f)Wait till spooling finish.
g)Close the document and application.
3)Update the XML with Print job info.
Code:
White.Core.Application application =White.Core.Application.Launch(@path);
Console.WriteLine("launch is done");
Thread.Sleep(3000);
SendKeys.SendWait("^(p)");
Thread.Sleep(3000);
SendKeys.SendWait("{ENTER}");
_printedTime = DateTime.Now;
Thread.Sleep(3000);
SendKeys.SendWait("%{F4}");
Now the problem is for waiting case I am blindly using Thread.Sleep(With Few seconds), which is not Ideal. So I need to know How I'll fix these issues using White Framework in C#.
Can anybody help me to fix this issue please. Any help will be appreciated.
Thanks in advance