Help or sample on CEF3 automation?
Hello,
I need to automate our CEF3 based application but could not find a tutorial or sample of TC, neither could I find an example in the forums (please kindly point me to one if I missed any).
So I just followed the sample on web automation and tried on my own (according to the help file, CEF test will be done using the Web plug-in of TC).
I downloaded a CEF3 client built by Marshal Greenblatt (owner and contributor of the CEF project, see: https://code.google.com/p/chromiumembedded/). He built a sample CEF3 client that can be downloaded from: http://www.magpcss.net/, the zipped file is “cef_binary_3.2171.1979_windows32_client.7z”.
The TC’s help file states:
When you launch a generic Windows application during test recording, TestComplete can automatically add that application to the Tested Applications collection of your project.
and
In order to expose a CEF-based application, you need to add it to the Tested Applications collection and then launch it in Simple run mode, while one of the following conditions is met:
The application's executable imports the libcef.dll library.
-- or --
The libcef.dll library and the application's executable are located in the same folder.
-- or --
The application has the injectCefHook command-line argument (in any letter case and with any prefix)
I checked the unzipped CEF client directory and found that the application executable and the libcef.dll file are in the same folder.
So I think I just need to record a simple test and then should be able to repeat the test.
Here’s what I did:
- Created a new project named “cef_mg_search”, with “Functional testing of web pages” and VBScript.
- Started recording: record script.
- Opened the CEF client (its default home is Google), entered “testcomplete”, clicked on the first found result (TC’s home page), clicked on “Features”, then closed the CEF client.
- Stopped recording.
- Saved project (and it appears the CEF application has been added under TestedApps).
- Tried to run the recorded test case.
However the test failed to finish. It was only able to launch the CEF client, but failed to enter the text into the searching field.
Then I tried to use the Object Spy on the CEF client, and it seems it could NOT recognize the objects such as the input text field and the buttons (“Google Search”, “I’m feeling lucky”).
See screenshots at the end.
Can someone help me with this?
It would be great if you could include a sample test case using the above CEF client, also using VBScript, and with descriptive programming (since I don’t want to use local object repository).
Thank you.
Launch CEF application from TestedApps before any usage. Only TC11.30 supports CefSharp.WPF applications.