Ask a Question

Can we disable orientation using Test complete.

suvidhshetty
Contributor

Can we disable orientation using Test complete.

We are using Android Lollipop Samsung device for testing.

We are able to change the orientation  using SetOrientation() with values "0" and "1", Portrait and Landscape respectively.

 

 

Is there a way to disable the Orientation so that SetOrientation will not change the orientation the device.

 

 

Thanks

Suvidh

9 REPLIES 9

Re: Can we disable orientation using Test complete.

Hi,

 

I'm not sure that I understand you scenario. Could you describe it in detail?

If you do not want to change orientation, you may just not use the "SetOrientation" method in your tests.

 

BTW, there is the "ResetOrientation" method in TestComplete. Perhaps, it will be useful for you. 

Regards,
Yuriy Peshekhonov
Customer Care Engineer
suvidhshetty
Contributor

Re: Can we disable orientation using Test complete.

Thanks for the reply.

 

Test case say "Oriention should not be changed if orientation setting is disabled."

How do we check for this scenario.

 

Thanks

Suvidh

 

 

 

 

AlexKaras
Community Hero

Re: Can we disable orientation using Test complete.

Hi Suvidh,

 

If Not desktop.GetOrientation = soPortrait Then ...

(See Example section of the https://support.smartbear.com/viewarticle/75375/ or https://support.smartbear.com/viewarticle/70224/ help topics)

 

Does this help?

 

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
suvidhshetty
Contributor

Re: Can we disable orientation using Test complete.

Hi Alex,

 

If I disable oriention then my verification will be I need to change the orientation and check that orientation has not changed.

can this be achived.

 

Thanks

Suvidh

AlexKaras
Community Hero

Re: Can we disable orientation using Test complete.

Suvidh,

 

I hope that I got what you are looking for...

You need to disable device orientation, do something in your tested application and check that the orientation is the same. Right?

If my guess is correct, then you may try ShellExecute method provided by TestComplete and execute adb command that will disable automatic device orientation. E.g. http://stackoverflow.com/questions/25864385/changing-android-device-orientation-with-adb

 

Is this what you are looking for?

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
suvidhshetty
Contributor

Re: Can we disable orientation using Test complete.

Hi Alex,

 

 

I went through the link and executed the shell commands

 

1. You may first need to turn off the automatic rotation

 

[adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0]

 

Rotation was off as expected 

 

2. Rotate to landscape

 

[adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1]

 

Rotation happened even when the rotation was off after executing then above shell command.

 

 

It didn't work any other way we can get this working.

 

 

Thanks

Suvidh

AlexKaras
Community Hero

Re: Can we disable orientation using Test complete.

Hi Suvidh,

 

So... Is the problem solved or not? (I am not sure I understood this from your reply, sorry...)

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
suvidhshetty
Contributor

Re: Can we disable orientation using Test complete.

Hi,

 

Problem is still there.

 

Thanks

Suvidh

AlexKaras
Community Hero

Re: Can we disable orientation using Test complete.

OK, then I will repeat the request from Yuriy and ask you to describe your test and the problem in detail.

I did not check it with Android documentation yet, but my current understanding from the end-user point of view is that with the auto-rotation disabled the screen will still be rotated if it is directly commanded to rotate to the given orientation from application's code.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: