Forum Discussion

ralibert's avatar
ralibert
Occasional Contributor
11 years ago
Solved

Mobile Button Key

Hi everyone!



I work on TestComplete since yesterday. I begin to be familiar with the keyword test and Code Snippet. I try to set a mobile with testComplete.

I use a Samsung Galaxy Note 2.



I have a problem with MobileButtonKey.mbkSettings, it worked fine yesterday. But today, I can't use it, on none of my devices.



The debugger said that the command work but I don't see the settings openned.



Does someone have an idea of the problem ? And a solution ?

Thanks in advance.



Roxane.

  • Hi Roxane,


     


    As far as I understand, to simulate pressing by using the mbkSettings constant, the corresponding button should be located on the body of your device. Note 2 doesn't have such a button.


    You can use the following code snippet to open Settings on the device:


    Mobile.Device("My Device").ShellExecute("am start -n com.android.settings/.LanguageSettings")


    How does it work for you?


     


  • Hi Roxane,


     


    As far as I understand, to simulate pressing by using the mbkSettings constant, the corresponding button should be located on the body of your device. Note 2 doesn't have such a button.


    You can use the following code snippet to open Settings on the device:


    Mobile.Device("My Device").ShellExecute("am start -n com.android.settings/.LanguageSettings")


    How does it work for you?


     

  • ralibert's avatar
    ralibert
    Occasional Contributor
    Hi,



    I found a solution, I used : Mobile.Device().PressButton(MobileButtonKey.mbkButtonMode)

    and

    ImageRepository.ParametrageSysteme.parametresBoutonPoliceNormale.Touch()



    Where parametresBoutonPoliceNormale is the image of the parameters button.



    But your solution is so much better! I go use it!!

    Thank you!