How to click the menu item from the application using pywinauto - python-3.7

import pywinauto,time
from pywinauto import Application
from pywinauto.keyboard import send_keys
from pywinauto.controls.win32_controls import ButtonWrapper
from pywinauto import mouse
app = Application().start(cmd_line="C:\\Users\\6141\\Desktop\\eval\\32bit\\ProSeriesLauncher.exe")
time.sleep(20)
pywinauto.mouse.click(button="left",coords=(1275,270))
time.sleep(20)
app.ProSeriesLauncher.MenuSelect("File->Open Client").click()
**Error occurs:**
pywinauto.findbestmatch.MatchError: Could not find 'ProSeriesLauncher' in 'dict_keys([])'
This application has a menu "file" where there is Open Client I need to open by click. Is there any method Application name: ProSeries Basic.

Related

How do I use local auth and bar code scanner in the same flutter project?

I building a flutter app that scans bar codes and also uses biometric auth in it. The problem is for package local_auth
MainActivity.kt should be like
import io.flutter.embedding.android.FlutterFragmentActivity;
public class MainActivity extends FlutterFragmentActivity {
// ...
}
but for scaning bar codes MainActivity.kt should be like
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
else it don't work. How do I use them both in the same project?
Currently you have to replace FlutterActivity with FlutterFragmentActivity yourself in FlutterBarcodeScannerPlugin.java (like this).
So you would want to use a fork of the flutter_barcode_scanner plugin where FlutterFragmentActivity is used or you use some other barcode scanner plugin.

How do I use multiple main activities in flutter?

I am building a flutter app which has these two plugins 1) local_auth 2) flutter_bar_code and they both use different main activities , for local auth the MainActivity.kt is like
import io.flutter.embedding.android.FlutterFragmentActivity
class MainActivity: FlutterFragmentActivity() {
}
and for flutter bar code scanner the MainActivity.tk is like
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
Flutter has a single MainActivity file. if you want to add more screen then please read doc and blogs here is one for you: Add Multiple screen

Not able to import main app module in xctest

When using XCTest I am not able to import the main module. Instead of like importing #testable import App it is import #testable import Pods_App, also not able to import the main app structs and data. How to resolve this issue?
Click on your test file, then press CMD + OPTION + 0. This will bring up the inspector panel on the right side of the screen. Look for the target membership section inside the panel and ensure that the your test module is checked.

No such module Error "NotificationCenter" WatchOS, Swift

I'm getting an module error in two of my controllers who tries to import the NotificationCenter framework. I have added the framework in "linked frameworks and libraries" but I'm still getting the error.
I even tried cmd + shift + k, but it did not do any good for me.
I also tried to set the framework search path to $(SRCROOT), but still same error.
I have two controllers with the import.
Linked frameworks and libraries
Added notificationCenter
TimeController
import WatchKit
import Foundation
import NotificationCenter error: "No such module 'NotificationCenter'"
SwipeController
import WatchKit
import Foundation
import NotificationCenter error: "No such module 'NotificationCenter'"
Any help would be much appreciated!
I agree with #David's comment, There are three targets for a single watchOS project.
You need to try these steps for each Target:
Select each target and go to -> Build Phases
Click on the right arrow. and click on the +
Finally, search for NotificationCenter and add the framework.
You need to try these steps for each target.

ui4j - Possible to screenshot the whole page?

I would like to capture a screenshot of a website including content that you can only see if you scrolled down.
Is that possible?
EDIT:
I already tried https://github.com/ui4j/ui4j/blob/master/ui4j-sample/src/main/java/com/ui4j/sample/ScreenCapture.java, but it did not capture the whole page, just the visible portion(inside my monitor's viewport).
page.show(true);
page.captureScreen(new FileOutputStream(file));
Yes, you could capture screenshot of the whole page with ui4j. Sample code:
package com.ui4j.sample;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import com.ui4j.api.browser.BrowserFactory;
import com.ui4j.api.browser.Page;
public class ScreenCapture {
public static void main(String[] args) throws FileNotFoundException {
Page page = BrowserFactory.getWebKit().navigate("https://www.google.com");
page.show(true);
page.captureScreen(new FileOutputStream(new File("google.png")));
}
}
Alternative solution:
I highly recommend to use cdp4j library for full page screen capture. Its a Java library which help to automate Chrome/Chromium based browser. Here is the sample code.