c# - Coded UI + Windows Phone 8.1 — get screen size and orientation? -


things tried:

windows.graphics.display.displayinformation winrt api — getforcurrentview throws saying “getforcurrentview must called on thread associated corewindow”, looks codedui tests run in process without windows.

getsystemmetrics winapi — returns correct size values, screen isn’t rotated.

enumdisplaysettingsex winapi — doesn’t fill values.

displayproperties winrt api — both currentorientation , nativeorientation portrait.

any other ideas?

thanks in advance.

codedui tests indeed run in separate process. uses specific form of "reflection" find controls in "other" processes. base class of codedui test controls uitestcontrol

the windows operating system design prevents other processes interrupting or snooping in on what's going on. so, msft had come abstraction of process under test, allow "see" other controls. addressiblity not actual control representation of control in other process. able control because mstest has ability "send messages control". limited fact can "get" information on other process via find in classes in namespace: microsoft.visualstudio.testtools.uitesting

a example of when testing webbrowsers, codedui uses class named browserwindow, not @ similar webbrowser classes found elsewhere. way can @ dom in codedui via browserwindow.document property. have fancy casting want. suspect have do.

  1. determine codedui class represent window automating.
  2. look methods or properties in class allow addressiblity need.
  3. if cannot find need have 1 option left drop down os messaging layer , see if can't (out of process) send , receive messages. it's complex , complicated topic of i've never been successful. note: of stuff done @ layer done in c++ helps know c++ , how windows uses (the apis)...

can else done?

yes, qa team should able establish few requirements/hooks them programming team. first thing ask "should unit test have done this?" codedui not true functional test no matter teaches, close unit testing in validating function.

secondly, can ask development team put hooks in code can "get @ things". in other words code must contain stuff qa team validation. in case can ask developers put in method calls getforcurrentview , passes results back. because codedui visual , not functional you'd have work them figure out how expose results @ gui layer.

anything else?

yes, 1 last thing can use fakes intercept method calls. if put hook in you, can call , intercept results of method call... hey, doesn't sound unit testing?


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -