Silk4j - how to connect to remote machine and start application there? - silktest

I have been using SilkTest for long time now, in 4Test connecting to remote machines and working on remote applications was so smooth. I have recently started to look at Silk4J (SilkTest 15.5) and trying to do remote connect and start some applications, so far unable to do.
I used Desktop remoteDesktop = new Desktop("remoteMachineName") to connect to remote machine but now stuck on starting applications there.
Any help here would be really helpful

With creating a Desktop instance for the remote machine you've done the first step.
Next you'll need to specify which application you want to test. Both locally and remotely how you do this is with a Basestate.
For example, assume you'd want to test notepad:
Desktop remote = new Desktop("remoteMachineName");
BaseState base = new BaseState("notepad.exe", "//Window[#caption='*Notepad']");
Window notepad = base.execute(remote);
Alternatively, you can set up a configuration for your project in the IDE integration by going to Silk4J > Configure applcations... and select Notepad.
Then the code would look like this:
Desktop remote = new Desktop("remoteMachineName");
BaseState base = new BaseState();
Window notepad = base.execute(remote);

Related

Alternative for host file modification in order to test site before moving to new server?

Is there an other option or browser add-on or program for testing/setting up a website with correct domain on a new server.
For example when I deploy a new website on a new server I would like to test it with the actual domain BEFORE changing the DNS settings so when I DO change the DNS the website works without problems.
Right now I modify the local host files to point domains to the new server (so I can test locally) but this seems a bit outdated..
Just wondering if there's something smarter/quicker..
Thanks for thinking with me!

Accessing Local Settings in Windows 10

I am developing a Line-of-Business app for a client. The client specified the devices that were supposed to be used (some Dell tablet with Windows 8.1). Now, that the development is almost done and we were ready to release the first phase of the application, the client informed us that they have changed their mind and all those Dell tablets will run windows 10. I upgraded one tablet that I used for development and testing to Windows 10 as well. The tablet uses a RESTful Web API to access data stored in a repository. Obviously, the URL of the Web API must be configured in the settings of the app before the app can retrieve any data from the repository.
So I create the App Package to sideload the app on the tablet. The installation works properly, the app starts well for the first time. I go into the settings, set the URL and close the app.
When I try to restart, the app gets stuck showing the Splash Screen. If I try to access the Settings, I am informed that the settings for my app are not available at that time. The only way to get out of this is to uninstall the app and reinstall it again.
This is the code I use to save and retrieve the settings:
public void SaveSetting<T>(string settingName, T value)
{
ApplicationData.Current.LocalSettings.Values[settingName] = value;
}
public T GetSetting<T>(string settingName)
{
var localSettings = ApplicationData.Current.LocalSettings.Values;
if (localSettings.ContainsKey(settingName))
{
var value = localSettings[settingName];
if (value is T)
{
return (T)value;
}
}
// else, in all other cases
return default(T);
}
An interesting thing I noticed is that sometimes, depending on what I try to save in the settings, the app starts. For example, I was playing with it and tried to save some garbage instead of the correct URL. So instead of "http://x.x.x.x:nnnnn" I saved "a". The app started correctly, I got past the splash screen but obviously, I couldn't get any data.
Any ideas as to what exactly is happening? Did the access method for local settings change in Windows 10?
I have been scratching my head over this for the past couple of days. Initially, I thought it is a matter of permissions to create the Local Settings file, so I dedicated a lot of energy trying to find a solution from that perspective. However, as I said, if I dump some garbage in the settings, it works, so it's not a matter of permissions. Could it be that and IP address like "x.x.x.x" needs to be saved in a different way than as a string?
Any advice would be highly appreciated.
TIA,
Eddie
After I added some logging to my application I was able to prove that the app had no issues reading the settings. It's what it tried to do with them that it did not work. The URL read from the settings was correct but when the app tried to make calls to the Web API, the calls threw an exception and the app stopped working. So this shouldn't have been a question in the first place.
Thanks, Eddie

How to change the admin port using the Google App engine launcher?

It's easy to change the port of the application using the launcher. Go to Edit>>Application Settings (or alternatively Ctrl+i) and change the port. Since I was getting an error similar to the one given below, I changed the application port from 8080 to 48080. Unfortunately, I am not able to change the admin port from 8000 to 48000, because of which I am getting the following error.
google.appengine.tools.devappserver2.wsgi_server.BindError: Unable to bind localhost:8000
I also tried the method illustrated in the following image (my reference being this link):
Regardless of what I try, my web-browsers (Chrome and Firefox) return a message similar to This webpage is not available. Any ideas are appreciated.
I have seen this before, when I had a crashed instance running on the port. You may have a frozen Python script running on that port. On a Mac, I can go to Activity Monitor and kill the process. Not sure if you can do that via task manager in Windows. You may need to restart machine.

How to control Windows Phone 8 Silverlight app from PC

I have an app written that I need to automate. I'd like to do the following:
Start the app remotely from a PC + USB, preferably via command
Trigger the event handlers for certain button presses
Keep in mind that this is a WP8 Silverlight app. Any suggestions would be appreciated!
This launches an app from PC:
XapDeployCmd.exe /launch <Product ID/Xap FileName> <targetdevice[:param]>
You can get targetdevice[:param] from XapDeployCmd.exe /enumerateDevices. You also know the Product ID of your app.
This XapDeployCmd is in C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\XAP Deployment
Example
XapDeployCmd.exe /launch f8ce6878-0aeb-497f-bcf4-65be961d4bba /targetdevice:0
To trigger event handlers
Install WAMP (or any server package) on your PC.
Write a simple GET/POST script
When a button is pressed, change a value in database
From the other device, regularly poll for changes in the same database entry

Remote access to a Nancy Self Host

I am creating a Nancy Module that will eventually be hosted inside of a Windows Service. I am currently running it inside of a WPF test application. To start the Nancy hosting, I am using Nancy.Hosting.Self and calling:
nancyHost = new Nancy.Hosting.Self.NancyHost(new Uri("http://localhost:8080"));
nancyHost.Start();
On my local machine I am able to go to a web browser and access my module by entering http://localhost:8080 into the address bar.
If I go to another machine I am not able to access the service. My Windows Firewall is turned off.
If I start the hosting with anything other than localhost in the baseUri, I get an "access denied" exception upon calling nancyHost.Start();
Is there something that I am missing? Should I be able to access the Nancy module from any machine as long as I know the IP:Port to the machine doing the hosting? Is there any type of "host headering" that I need to be aware of?
Thanks for your help with this.
Windows will prevent you from listening on ports without permission. You can either run your process as administrator, or add permission using "netsh":
netsh http add urlacl url=http://+:8080/app user=domain\user
The "+" is a wildcard so it can listen on any IP.
Normally you'd handle the latter during installation, so you may want to run as admin to debug, then make sure your installer sets the relevant permissions.
For local debugging, use
http://+:8733/Design_Time_Addresses
You can add any subdirectory you like, for example
http://+:8733/Design_Time_Addresses/myService
and debug it at
http://localhost:8733/Design_Time_Addresses/myService
without running your IDE (Visual Studio?) as Administrator.
Look this: Self-Hosting-Nancy
The Host Configuration: UrlReservations, add under code:
var configuration = new HostConfiguration
{
UrlReservations = new UrlReservations { CreateAutomatically = true }
};
OK, you can create your host!~

Resources