I'm using the following code to set the back command on the Toolbar in a Form:
Command back = new Command("Back") {
public void actionPerformed(ActionEvent ev) {
mainForm.showBack();
}
};
Style s = UIManager.getInstance().getComponentStyle("Title"); // getTitleStyle();
FontImage backIcon = FontImage.createMaterial(FontImage.MATERIAL_ARROW_BACK, s);
this.getToolbar().addCommandToLeftBar("", backIcon, back);
This works fine on iOS and Android, but on Windows Phone (Eumlator) I get java.lang.RuntimeException: Unsupported operation. After doing some debugging in the C# code, I found that the Exception is thrown in Font.derive() that calls CodenameOneImplementation.deriveTrueTypeFont(), which is aparently not implemented on Windows Phone.
Are Material icons simply not supported on the current Windows Phone port, or is there a workaroung for this? Or am I doing something wrong?
The old Windows Phone port doesn't support a great deal of functionality including icon fonts.
We are working on a completely new ground up port that should support everything.
Notice that icon fonts do work in the JavaScript port and you should be able to deploy that everywhere.
Related
I am automating desktop application. The application is base on an electron so I can easy to get XPATH and other things like a web application. But I am stuck on windows alert.
I am trying a robot class. but a key event not supporting in electron base application.
robot.keypress(keyevent.vk_enter)
robot.keyrelease(keyevent.vk_enter)
I am trying normal selenium web driver code to handle pop but selenium does not support windows popup.
I am trying to AutoIT tools. with this code
ControlFocus("petpooja","","Button1")
ControlClick("petpooja","","Button1")
and this code
SEND("{ENTER}")
With this code
Runtime.getRuntime().exec(".\\Driver\\autoitpath\\EnterPopUp.exe");
I am also trying to use Sikuli but that also not supporting.
public Screen s = new Screen();
s.click("./Driver/Image/Popup.PNG");
Please help me guys on this I also attached the image please refer to this?enter image description here
I have developed a simple WPF applicaiton. I want to do some UI automation testing on my app. I started following this tutorial on how to do automation using Appium and Windows Application Driver.
As a part of setting up the test environment for testing Windows Calculator app, the following lines are added to the test script :
protected const string WindowsApplicationDriverUrl = “http://127.0.0.1:4723";
DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.SetCapability(“app”, “57b3a460–8843–4d84–822a-9f316274c2bf_tz6ph9wdjhqw8!App”);
IOSDriver<IOSElement> AppSession = new IOSDriver<IOSElement>(new Uri(WindowsApplicationDriverUrl), appCapabilities);
Looking at the 3rd line, an application identifier is provided to set DesiredCapabilities. My problem is that I have trouble finding or generating a similar app ID for my WPF application. Further down in the tutorial, author mentions:
"In the third line, we set a weird identifier for the “app” device capability. You need to replace this value with yours. It can be found the generated AppX\vs.appxrecipe file under RegisteredUserModeAppID node.
<RegisteredUserModeAppID>57b3a460–8843–4d84–822a-9f316274c2bf_tz6ph9wdjhqw8!App</RegisteredUserModeAppID>"
Can you tell me how this appID can be generated in Visual Studio? Also, is there other ways to set DesiredCapabilities without providing an appID? Can a GUID be used for this purpose?
Only UWP apps have an application id, classic Windows applications can be started with the path to the executable:
appCapabilities.SetCapability("app", pathToYourExecutable);
See also the readme of WinAppDriver:
Testing a Classic Windows Application
You should be able to find this when you're debugging your app.
If you debug the app and set a breakpoint at the first instance.
Then in your debug tab you should be able to view the node you're looking for.
I have issues with initializing CefSharp3. The control give a blank page after initializing.
I follow the instructions from CefSharp Wiki page (https://github.com/cefsharp/CefSharp/wiki/Quick-Start and http://ourcodeworld.com/articles/read/173/how-to-use-cefsharp-chromium-embedded-framework-csharp-in-a-winforms-application)
The problem is that when I build the application for x64 i get a blank page, but it works fine in x86.
The only code in my WinForms project is this:
public ChromiumWebBrowser chromeBrowser;
public void InitializeChromium()
{
CefSettings settings = new CefSettings();
// Initialize cef with the provided settings
Cef.Initialize(settings);
// Create a browser component
chromeBrowser = new ChromiumWebBrowser("http://ourcodeworld.com");
// Add it to the form and fill it to the form window.
this.Controls.Add(chromeBrowser);
chromeBrowser.Dock = DockStyle.Fill;
}
public Form1()
{
InitializeComponent();
// Start the browser after initialize global component
InitializeChromium();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Cef.Shutdown();
}
I also tried adding a panel, and initializing ChromiumBrowser in the panel with panel1.Controls.Add(chromeBrowser) instead of this.Controls.add(chromeBrowser), but the issue is still there.
I found this in the troubleshooting section at CefSharp wiki:
https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting
b) The developer tools. Add a button to your form and make a call to "browser.ShowDevTools()". If you can see a document has loaded and you have a DOM in there, then your problem is a display output one and your most likely problem is one of not setting 'Dock' correctly, or some other setting is causing the browser to render offscreen/headless. If you get a blank tool window, or no tool window at all, then CefSharp has failed to initialize correctly, so you have a set-up issue to troubleshoot.
This is exactly the symptoms that I experience.
I tried creating the same project on my laptop (MacBook Pro with Win7, VS2013 and .NET 4.5.2) and it worked like a charm. This means something is up with my workstation (win10, VS2015 .NET 4.5.3).
Any ideas?
This appears to be a bug in the latest build. The solution for now is to use the v51.0.0 build.
You can do this quite easily in the NuGet package manager in VS2015, or if your using VS2013, use the "--version 51.0.0" option when installing cefsharp from the package manager command line.
The issue for the problem is here:
https://github.com/cefsharp/CefSharp/issues/1870
Keep an eye on the issue for future solutions.
Update 28/11/2016
This is a bug in the current V53 release of CefSharp. It's been confirmed by the CefSharp team and is addressed in issue #1819 (https://github.com/cefsharp/CefSharp/issues/1819)
The bug has been apparently fixed, but will not be released until V55.
The solution for now, is to either go back to V51 or to build your own version from source for V55.
I want to run my Chrome(example : System.Diagnostics.Process.Start("http://www.abc123.com");) from WPF application and then fill fields (password and login) automatically, but i DO NOT want to use something like webbrowser control.
Thx for help
You will need to download a WebDriver and the chrome driver.
Include the dlls in your project and you are good to go.
Short exmaple:
IWebDriver driver = new ChromeDriver(#"D:\Download\chromedriver");
driver.Navigate().GoToUrl("http://www.abc123.com");
IWebElement myField = driver.FindElement(By.Id("login"));
myField.SendKeys("username");
For more information see this tutorial.
I have a WPF application which uses CEF to display web content. My question is, is there a way to debug the Javascript/Web parts inside a WPF application?
You may also use ShowDevTools() extension method (source)
ChromiumWebBrowser browser = new ChromiumWebBrowser();
browser.ShowDevTools(); // Opens Chrome Developer tools window
Enable remote debugging in your application:
C# (CefSharp)
CefSettings.RemoteDebuggingPort = 8088;
C++
CefSettings settings;
settings.remote_debugging_port = 8088;
then run your app and point your browser to http://localhost:8088/ to access the Chromium developer console (the same you have in Chrome with Ctrl+Shift+j)
While the accepted answer is correct, it doesn't really have enough detail.
I got this working in CefSharp using the WinForms control in a WPF application. (the WinForms control seems to have better performance). The code for remote debugging will probably be very similar for the WPF control though.
var settings = new CefSettings { RemoteDebuggingPort = 8088 };
Cef.Initialize(settings);
WindowsFormsHost.Child = new ChromiumWebBrowser(url);
Then go to http://localhost:8088/ in your browser.
To use 'ShowDevTools()' you will need first verify if the browser is initialized.
An example solution:
//Add an event to check
ChromeBrowser.IsBrowserInitializedChanged += ChromeBrowser_IsBrowserInitializedChanged;
//Declare the event method to be called
private void ChromeBrowser_IsBrowserInitializedChanged(object sender, IsBrowserInitializedChangedEventArgs e)
{
if (e.IsBrowserInitialized)
{
ChromeBrowser.ShowDevTools();
}
}
To open the Chromium Dev-Tools window you can do the following:
CefBrowser.GetBrowser().GetHost().ShowDevTools();
This is similar to Eido95's answer, but it doesn't require the extension methods, which essentially just wrap these method calls.
NOTE: The control needs to be initialized before calling this method can be called. If you're wiring-up and F12-like functionality this shouldn't be a problem. If you're trying to do this when the app is starting you will need to listen for the ChromiumWebBrowser.IsBrowserInitializedChanged event
An alternative can be to launch cef with --enable-chrome-runtime.
You'll have the fully featured debugger (link files on disk and edit them from the debugger)