Forum Discussion
In your screenshots you can see that Test Complete is picking up the native android objects in your object browser, so there is support. Without more code examples I can't really tell you why you are having issues interacting with objects.
https://github.com/react-native-material-design/demo-app I even downloaded the apk from here to do a test and had no issues interacting with and playing back scripts.
Mobile.Device("emulator-5554").Process("com.demoapp").RootLayout("").Layout("com.facebook.react.ReactRootView").View("com.facebook.react.views.drawer.ReactDrawerLayout").View("com.facebook.react.views.view.ReactViewGroup").View("com.facebook.react.views.view.ReactViewGroup").View("com.facebook.react.views.view.ReactViewGroup", 2).View("com.facebook.react.views.view.ReactViewGroup", 2).TextView("com.facebook.react.views.text.ReactTextView").Touch();
It's even picking up the same type of objects as shown in your object browser. Can you provide code examples? And properties of the first object it's failing on?
Attaching the properties of the Username Text Feild.
If Test complete works, it will be huge benefit and more reusable. Thanks for supporting..
- cunderw6 years agoCommunity Hero
What does the code that is failing look like?
Can you do a test and with the application running, use the full name of the text box and send keys to it without, reinstalling or launching the test? I'm thinking this might be a timing or mapping issue.
- ashwinpendyala6 years agoOccasional Contributor
Below is the code i have written for login screen. Tried in all ways by
1. Launching the instrumented app by script and send keys to username and password
2. Launched the instrumented app by manually and send keys to username and password
For all the ways, i see script is failing to perform operations. Suspect any code related issue from developers
Public Function AndroidMob_Launch
'Installing the Android Agent
call Androidagent
'Install the package from Tested Apps if it has not been installed yet
TestedApps.Universal.Run
aqUtils.Delay 15000
Mobile.Device.Process("com.universalui").Layout("NO_ID").Layout("action_bar_root").Layout("content").Layout("NO_ID").Layout("NO_ID").Layout("com.reactnativenavigation.views.ContentView").View("com.facebook.react.views.view.ReactViewGroup").View("com.facebook.react.views.view.ReactViewGroup", 2).EditText("com.facebook.react.views.textinput.ReactEditText").keys "mini318@cam1.com"
Mobile.Device.Process("com.universalui").Layout("NO_ID").Layout("action_bar_root").Layout("content").Layout("NO_ID").Layout("NO_ID").Layout("com.reactnativenavigation.views.ContentView").View("com.facebook.react.views.view.ReactViewGroup").View("com.facebook.react.views.view.ReactViewGroup", 3).EditText("com.facebook.react.views.textinput.ReactEditText").keys "123456aA"
Mobile.Device.Process("com.universalui").Layout("NO_ID").Layout("action_bar_root").Layout("content").Layout("NO_ID").Layout("NO_ID").Layout("com.reactnativenavigation.views.ContentView").View("com.facebook.react.views.view.ReactViewGroup").View("com.facebook.react.views.view.ReactViewGroup", 6).View("com.facebook.react.views.view.ReactViewGroup").Click
aqUtils.Delay 45000
if Mobile.Device.Process("com.*").RootLayout("").ViewFlipper("NO_ID").Layout("NO_ID", 2).Layout("SCROLL_LAYOUT").View("NO_ID").View("NO_ID").View("NO_ID").View("NO_ID").View("NO_ID").View("NO_ID").View("NO_ID").TextView("NO_ID").getText="My Home" then
Mobile.Device.Process("com.*").RootLayout("").ViewFlipper("NO_ID").Layout("NO_ID", 2).Layout("SCROLL_LAYOUT").View("NO_ID").View("NO_ID").View("NO_ID").View("NO_ID").View("NO_ID").View("NO_ID").View("NO_ID").TextView("NO_ID", 2).Click
aqUtils.Delay 35000
Mobile.Device.Touch 821, 1059
aqUtils.Delay 5000
Mobile.Device.Process("com.*").RootLayout("").ViewFlipper("NO_ID").Layout("NO_ID", 2).Layout("SCROLL_LAYOUT").View("NO_ID").Layout("ny0k.cc").View("NO_ID").View("NO_ID", 2).Button("NO_ID", 2).Click
Log.UnlockEventsIf ((Mobile.Device.Process("com.*").RootLayout("").ViewFlipper("NO_ID").Layout("NO_ID", 2).Layout("SCROLL_LAYOUT").View("NO_ID").View("NO_ID", 2).View("NO_ID").View("NO_ID", 3).View("NO_ID").View("NO_ID", 2).VisibleOnScreen)="True") then
Log.Picture Mobile.Device.Desktop.Picture,"Mobile App launched successfully"
Else
Log.Error "Launch is not successfull"
End If
Else
Log.Error "No Thermostat is found with My Home name"
End If
End Function
Function Androidagent()
'Installing the Android Agent
AgentApkPath = "C:\Program Files (x86)\SmartBear\TestComplete 12\Bin\Extensions\Android\AndroidAgent.apk"
Set Agent = Mobile.Device.PackageManager.GetPackageFromAPK(AgentApkPath)
Mobile.Device.PackageManager.InstallPackage(Agent)
Mobile.Device.PackageManager.LaunchPackage(Agent)
aqUtils.Delay 5000
Log.LockEvents 10
Mobile.Device.PressBack
Mobile.Refresh
Log.UnlockEvents
End Function - cunderw6 years agoCommunity Hero
I assume this is VBScript, which I'm not super familiar with.
What happens if you just record typing into the text box and try to play that back? You are definitely seeing the objects / can access them so something else has to be going on preventing your playback from interacting with them.
If a record / playback works, then we know it's TC or the application / environment. If that doesn't work either you might need to work more directly with your support rep.
- ashwinpendyala6 years agoOccasional Contributor
With the Record & Playback, i can record the operations on login screen and playback successfully by entering Username, Password & Click on "Sign In" button
But in the same way after user logged into app, if i try to Record the operations, no operations are getting recorded. So how to rule out this one??
But i am able to see all the Objects from Object Browser. Attaching screenshot for reference.
- ashwinpendyala6 years agoOccasional Contributor
Related Content
Recent Discussions
- 2 hours agojstaehlin
- 19 hours agoAivanitskiy
- 22 hours agonastester