Forum Discussion
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.UnlockEvents
If ((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
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 days agoGane195