Connected to Nokia 3.0
Is it possible to get the current time?
/mobileapp[@title='Android OS']/form[@rid='R.id.statusBarBackground']
Android & get time
Android & get time
You do not have the required permissions to view the files attached to this post.
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: Android & get time
Hello SanMan,
You can use "adb" to fetch the system time of your USB ( ! ) connected Android device:
Get the "Address" of your connected device (needed within the code snippet -> deviceAddress:
and use the following code to fetch the time of your device:
Robin
You can use "adb" to fetch the system time of your USB ( ! ) connected Android device:
Get the "Address" of your connected device (needed within the code snippet -> deviceAddress:
and use the following code to fetch the time of your device:
public void GetAndroidSystemTime() { string adb = @"C:\Program Files (x86)\Ranorex\Studio\Bin\Runtime\RxEnv\Android\Tools\adb.exe"; string deviceAddress = "00eXXXXXXXce27"; System.Diagnostics.Process proc= new Process(); proc.StartInfo.FileName = adb; proc.StartInfo.Arguments = string.Format("-s {0} shell date ", deviceAddress); proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.UseShellExecute = false; proc.Start(); proc.WaitForExit(); //Read redirected output and log to report var output = proc.StandardOutput.ReadToEnd(); Report.Info("Android System Time: " + output); }Hope this helps
Robin
You do not have the required permissions to view the files attached to this post.
Re: Android & get time
Hi Robin,
thank you! It worked perfectly!!
Now I have a new problem:
I have a MobileUiElement > AccessibilityLabel (System.String) which I can find with Spy. Also screenshot can also be achieved.
But when this data change, AccessibilityLabel string is not updated, but screenshot is updated.
Is there some command (Refresh/Update/?) that could be used to get the updated AccessibilityLabel string value ?
Is it possible to use somehow JQuery or something?
thank you! It worked perfectly!!
Now I have a new problem:
I have a MobileUiElement > AccessibilityLabel (System.String) which I can find with Spy. Also screenshot can also be achieved.
But when this data change, AccessibilityLabel string is not updated, but screenshot is updated.
Is there some command (Refresh/Update/?) that could be used to get the updated AccessibilityLabel string value ?
Is it possible to use somehow JQuery or something?
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: Android & get time
Hi SanMan,
Great!
"But when this data change, AccessibilityLabel string is not updated, but screenshot is updated."
How to you access the element. Did you add the element to your repository or do you directly access it via code?
Also please upload a Ranorex snapshot file of the mentioned element: Snapshot files
Cheers,
Robin
Great!
"But when this data change, AccessibilityLabel string is not updated, but screenshot is updated."
How to you access the element. Did you add the element to your repository or do you directly access it via code?
Also please upload a Ranorex snapshot file of the mentioned element: Snapshot files
Cheers,
Robin
Re: Android & get time
Hi Robin,
I have add the element to repository.
Is it possible to use JQuery with Ranorex?
$('#status').text();
This is how I can the valid text with browser version & console
Can I somehow do this with user code?
I have add the element to repository.
Is it possible to use JQuery with Ranorex?
$('#status').text();
This is how I can the valid text with browser version & console
Can I somehow do this with user code?
Re: Android & get time
Hi,
Well, this is not directly Ranorex-related question. It's rather .Net-related question? Generally speaking, it should be possible to call JQuery code from C# code. Have you tried google?...
https://stackoverflow.com/a/17285414
https://stackoverflow.com/questions/172 ... om-c-sharp
Well, this is not directly Ranorex-related question. It's rather .Net-related question? Generally speaking, it should be possible to call JQuery code from C# code. Have you tried google?...
https://stackoverflow.com/a/17285414
https://stackoverflow.com/questions/172 ... om-c-sharp
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Android & get time
Thank you for the links.
I got my problem solved by touch() item twice before get value
I got my problem solved by touch() item twice before get value