I'm trying to automate EXE installation using Appium driver. Taken AutomationID/Name/Classname from EXE installation wizard by using inspect tool. Its creating desktop session. But, it's unable to interact with Install Shield Wizard Windows installer. Getting error message like "An element could not be located on the page using the given search parameters".
Please provide any solution or suggestion to handle this issue.
AppiumDriver<RemoteWebElement> NotepadSession;
DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.setCapability("app", #"C:\Windows\System32\notepad.exe");
NotepadSession = new WindowsDriver<RemoteWebElement> (new URL("http://127.0.0.1:4723"), appCapabilities);
NotepadSession.FindElementByClassName("Edit").SendKeys("This is some text");
By using above code able to launch the notepad. But, Its not doing any action on it.
Referred
Related
I'm trying to just run the calculator test C# example (https://github.com/Microsoft/WinAppDriver/tree/master/Samples/C%23/CalculatorTest) inside visual studio 2017. When I download and build the example, it shows several lines as deprecated;
DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.SetCapability("app", CalculatorAppId);
appCapabilities.SetCapability("deviceName", "WindowsPC");
and one as an error that needs to be changed;
CalculatorSession.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(1.5));
to
session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1.5);
.
I get errors such as this for each test (Addition, division, Multipluication, Substraction, Templatized) when I try and run them:
Test Name: Addition Test
FullName: CalculatorTest.ScenarioStandard.Addition Test
Source: C:\Users[user]\Downloads\WinAppDriver-master\Samples\C#\CalculatorTest\ScenarioStandard.cs
: line 32 Test Outcome: Failed Test Duration: 0:00:00
Result StackTrace: at OpenQA.Selenium.Appium.AppiumDriver1..ctor(Uri
remoteAddress, ICapabilities desiredCapabilities, TimeSpan
commandTimeout) at OpenQA.Selenium.Appium.AppiumDriver1..ctor(Uri
remoteAddress, ICapabilities desiredCapabilities) at
OpenQA.Selenium.Appium.Windows.WindowsDriver`1..ctor(Uri
remoteAddress, DesiredCapabilities desiredCapabilities) at
CalculatorTest.CalculatorSession.Setup(TestContext context) in
C:\Users[user]\Downloads\WinAppDriver-master\Samples\C#\CalculatorTest\CalculatorSession.cs:line
42 at CalculatorTest.ScenarioStandard.ClassInitialize(TestContext
context) in
C:\Users[user]\Downloads\WinAppDriver-master\Samples\C#\CalculatorTest\ScenarioStandard.cs:line
101 Result Message: Class Initialization method
CalculatorTest.ScenarioStandard.ClassInitialize threw exception.
System.TypeLoadException: System.TypeLoadException: Method 'Dispose'
in type 'OpenQA.Selenium.Appium.Service.AppiumCommandExecutor' from
assembly 'appium-dotnet-driver, Version=3.0.0.2, Culture=neutral,
PublicKeyToken=null' does not have an implementation..
I have Appium downloaded and running in the background when I do this, but it appears to sit brick like.
I'm a c# app developer, and really don't have a clue what I'm doing with Appium/WinAppDriver (I've just been told to figure it out), and after looking at this for a bit am at a loss as how to troubleshoot whats going on here. I don't know if this is an Appium issue, a WinAppDriver issue, or something else, and help would be appreciated.
Solved by updating (inside Visual Studio) to the latest beta drivers (4.0.0.4-beta) and then converting code to use the new format.
Use:
AppiumOptions options = new AppiumOptions();
options.AddAdditionalCapability("deviceName", "WindowsPC");
options.AddAdditionalCapability("platformName", "Windows");
options.AddAdditionalCapability("app", NotepadAppId);
session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), options);
Rather than the shown
DesiredCapabilities appCapabilities = new DesiredCapabilities();
Dude, I didn't have any luck at all with those examples but what I have managed to do is launch an application from it's filepath and test that. I also had to figure out that you must set "Developer Mode" to On (nobody tells you that!) and a few other things. Here are my notes that I made for myself and other developers...
Installing and Running Windows Application Driver
1.Download Windows Application Driver installer from https://github.com/Microsoft/WinAppDriver/releases
2.Run the installer on a Windows 10 machine where your application under test is installed and will be tested
3.Set Developer Mode to On (Start -> type "Use Developer Features"), open that and set Developer Mode On...
4.Run WinAppDriver.exe from the installation directory (E.g. C:\Program Files (x86)\Windows Application Driver)
Install Win App Driver Recorder, then launch it. Click the little yellow rectangle icon at the top of it.
https://github.com/Microsoft/WinAppDriver/releases
Using the above, the examples begin to make more sense but as I said, I have only tested apps where I can launch the executable from it's filepath...
I'm building a windows service that retrieves information about different hardware, and after that it stores the information in a database, right now that part is done and im trying to install that service in different computers, and i wanted to know if the little window that pops up during the installation, called Set Service login, is possible to set some default values in those textboxes.
Thanks in advance.
If you use the Visual Studio Installer you could try this:
View the code of the processInstaller and go into InitializeComponent() methode.
There you can set the following properties for an existing local account:
this.servicename_processInstaller.Password = "xxxxx";
this.servicename_processInstaller.Username = ".\\localServiceUserAccount";
This prevent to prompt the window.
I developed a web software with Visual Studio. Within this web software when I click on a button, the user's computer should run an application given as an .exe file. This application is a console application and it needs to receive commandline parameters.
I've tried to run it with Javascript, but it was removed due to security issues.
Dim startInfo As New ProcessStartInfo("C:\ProgramAdres\Program.exe")
startInfo.WindowStyle = ProcessWindowStyle.Normal
startInfo.Arguments = "arguments"
Process.Start(startInfo)
This code successfuly runs the application, but on the server side. I need your help because I do not know ActiveXand don't know how to start.
I created a solution VS2010 C# with the WCF service, the library to get data, the service is working fine in a console application in the solution. No problem.
I have to use it on a VS2008 project (and probably later on a VS2005) for the older projects. Then I start VS2010 I get the "WCF Test Client". At this time in the VS2008, I tried to "Add a web reference" on the local machine... no result.
Then I tried to create a console application with Vs2010 to host it, I did this :
Uri baseAddress = new Uri("http://localhost:8080/hello");
using (ServiceHost host = new ServiceHost(typeof(SecurityAccessWCF.WCFSecurityService), baseAddress))
{
// Enable metadata publishing.
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
host.Description.Behaviors.Add(smb);
host.Open();
Console.WriteLine("The service is ready at {0}", baseAddress);
Console.WriteLine("Press <Enter> to stop the service.");
Console.ReadLine();
// Close the ServiceHost.
host.Close();
}
I get an error on the Open(), I get this error "AddressAccessDeniedException - HTTP could not register URL... Your process does not have access rights" (the link provided is not clear, I'm on Win7 x64 as local admin and in a domain)
Shift + Mouse Right Click on Visual Studio shortcut and select Run as administrator
This way you should be able to host it.
Alternately, you could build the project and run the resulting console application the same way under admin account.
Thats a standard error meaning your application cant register the domain. Normally this is a problem on vista/windows 7 with security. Log in as administrator and run netsh http add urlacl url=http://+:80/Localhost user=DOMAIN\user
Here is a msdn article with more information
My application (developed using C#.net) is open now i uninstall, InstallShield gives message stating the application is already open and whether really want to close the application. Selection 'Ignore' continues uninstall. Some files and the exe of the application are not closed. How to close them by installshield on uninstall. Or there are some properties I have to set. I know adding a custom action at uninstall i can kill the process, but shouldn't installshield do it?
If your goal is to restart the open applications and not honor the "Ignore" selection, you might consider setting the "REBOOT" property to "Force". That will ask that user to restart the system, thus achieving your desired result.
If your project type is InstallScript MSI or it supports Installscript, i prefer to write code for this for example:
export prototype _Server_UnInstalling();
function _Server_UnInstalling()
STRING Application, ServiceName;
begin
//application name
Application = "Demo";
MessageBox("In _Server_UnInstalling",INFORMATION);
//Check whether application is running or not.
if ProcessRunning( Application ) then
MessageBox("Demo is running",INFORMATION);
//Close server Application
ProcessEnd(Application);
endif;
//if application is having service at the background then
ServiceName = "Demo Server";
//Uninstall the server windows services on uninstallation.
ServiceRemoveDuringUninstallation(ServiceName);
end;
The above example give the skeleton, you need to implement the logic for ProcessRunning, ProcessEnd and ServiceRemoveDuringUninstallation methods, you can refer Installshield help doc they have given documentation with along with source code
hope this helps...