Corecrontab

crontab  时间:2021-01-12  阅读:()
SilkTest18.
0TestingMobileApplicationsMicroFocusTheLawn22-30OldBathRoadNewbury,BerkshireRG141QNUKhttp://www.
microfocus.
comCopyrightMicroFocus1992-2017.
Allrightsreserved.
MICROFOCUS,theMicroFocuslogoandSilkTestaretrademarksorregisteredtrademarksofMicroFocusIPDevelopmentLimitedoritssubsidiariesoraffiliatedcompaniesintheUnitedStates,UnitedKingdomandothercountries.
Allothermarksarethepropertyoftheirrespectiveowners.
2017-06-14iiContentsTestingMobileApplications4Android4PrerequisitesforTestingMobileApplicationsonAndroid4TestingMobileApplicationsonAndroid4TestingHybridApplicationsonAndroid5InstallingaUSBDriver6EnablingUSB-Debugging7RecommendedSettingsforAndroidDevices7ConfiguringtheAndroidEmulatorforSilkTest7TestedConfigurationsforParallelTestExecution8iOS10PrerequisitesforTestingMobileApplicationsoniOS11TestingNativeMobileApplicationsonaPhysicaliOSDevice12TestingNativeMobileApplicationsonaniOSSimulator13TestingMobileWebApplicationsonaPhysicaliOSDevice14TestingMobileWebApplicationsonaniOSSimulator14TestingHybridApplicationsoniOS15PreparinganiOSDeviceforTesting16PreparinganiOSAppforTesting16InstallingtheSilkTestInformationServiceonaMac16PreparingaMactoTestMobileApplicationsoniOS17UsingaPersonalTeamProfileforTestingonPhysicaliOSDevices19EditingthePropertiesoftheSilkTestInformationService20UninstallingtheSilkTestInformationServicefromaMac20RecommendedSettingsforiOSDevices21RunningExistingScriptsoniOSUsingXCUITest21TestinganInstalledApp21RecordingMobileApplications22SelectingtheMobileDeviceforTestReplay22InteractingwithaMobileDevice23ReleasingaMobileDevice23ReleasingaMobileDeviceAfterRecording23ReleasingaMobileDeviceAfterReplay24EditingRemoteLocations24ConnectionStringforaMobileDevice25TroubleshootingwhenTestingMobileApplications28HowCanIUseChromeforAndroidtoReplayTests32LimitationsforTestingMobileWebApplications33LimitationsforTestingNativeMobileApplications34ClickingonObjectsinaMobileWebsite36UsingExistingMobileWebTests36Contents|3TestingMobileApplicationsSilkTestenablesyoutoautomaticallytestyournativemobileapplications(apps)andmobilewebapplications.
AutomaticallytestingyourmobileapplicationswithSilkTestprovidesthefollowingbenefits:Itcansignificantlyreducethetestingtimeofyourmobileapplications.
Youcancreateyourtestsonceandthentestyourmobileapplicationsonalargenumberofdifferentdevicesandplatforms.
Youcanensurethereliabilityandperformancethatisrequiredforenterprisemobileapplications.
ItcanincreasetheefficiencyofQAteammembersandmobileapplicationdevelopers.
Manualtestingmightnotbeefficientenoughforanagile-focuseddevelopmentenvironment,giventhelargenumberofmobiledevicesandplatformsonwhichamobileapplicationneedstofunction.
Note:TotestnativemobileapplicationsorhybridapplicationswithSilkTest,yourequireanativemobilelicense.
Foradditionalinformation,seeLicensingInformation.
Note:SilkTestprovidessupportfortestingmobileappsonbothAndroidandiOSdevices.
Forinformationonthesupportedoperatingsystemversionsandthesupportedbrowsersfortestingmobileapplications,refertotheReleaseNotes.
AndroidSilkTestenablesyoutotestamobileapplicationonanAndroiddeviceoranAndroidemulator.
PrerequisitesforTestingMobileApplicationsonAndroidBeforeyoucantestamobileapplication(app)onanAndroiddeviceoronanAndroidemulator,ensurethatthefollowingprerequisitesaremet:EnsurethatJavaisinstalledonthemachineonwhichSilkTestisrunning,andthatthepathtoJavaisaddedtothePathenvironmentvariable.
SilkTestrequireseitheraJREoraJDKformobiletesting.
IfJavaisnotinstalled,addC:\ProgramFiles(x86)\Silk\SilkTest\ng\jre\bintothePath.
Ifyouhavecreatedyourownhybridappbyaddingawebviewtoanativemobileapp,addthefollowingcodetotheapptomakeyourapptestablewithSilkTest:WebView.
setWebContentsDebuggingEnabled(true);webView.
getSettings().
setJavaScriptEnabled(true);SilkTestdoesnotsupportshowingaliveviewofthedevicescreenforAndroid4.
4.
MicroFocusrecommendsusingAndroid5orlater.
TestingMobileApplicationsonAndroidTotestamobileapplicationonaphysicalAndroiddeviceoronanAndroidemulator,performthefollowingtasks:1.
EnsurethatyouhavemettheprerequisitesfortestingmobileapplicationsonAndroid.
Foradditionalinformation,seePrerequisitesforTestingMobileApplicationsonAndroid.
2.
IfyouwanttotestthemobileapplicationonanAndroidemulator,configuretheemulatorsettingsforSilkTest.
Foradditionalinformation,seeConfiguringtheAndroidEmulatorforSilkTest.
4|TestingMobileApplications3.
StarttheAndroidemulatororconnectthedevicetothemachineonwhichSilkTestisinstalled.
4.
IfyouwanttotestthemobileapplicationonaphysicalAndroiddevicethatyouareusingforthefirsttimeonthismachine,installtheappropriateAndroidUSBDriveronthemachine.
Foradditionalinformation,seeInstallingaUSBDriver.
5.
IfyouwanttotestthemobileapplicationonaphysicalAndroiddevice,enableUSB-debuggingontheAndroiddevice.
Foradditionalinformation,seeEnablingUSB-Debugging.
6.
CreateaSilkTestprojectforyourmobileapplication.
7.
Createatestforyourmobileapplication.
8.
Recordtheactionsthatyouwanttoexecuteinthetest.
WhenyoustarttheRecordingwindow,theSelectApplicationdialogboxopens.
9.
Totestamobilewebapplication:a)SelecttheWebtab.
b)Selectthemobilebrowserthatyouwanttouse.
c)SpecifythewebpagetoopenintheEnterURLtonavigatetextbox.
10.
TotestanativemobileapplicationoraHybridapplication:Note:TotestnativemobileapplicationsorhybridapplicationswithSilkTest,yourequireanativemobilelicense.
Foradditionalinformation,seeLicensingInformation.
a)SelecttheMobiletab.
b)Selectthemobiledevice,onwhichyouwanttotesttheapp,fromthelist.
c)ClickBrowsetoselecttheappfileorenterthefullpathtotheappfileintotheMobileappfiletextfield.
SilkTestsupportsHTTPandUNCformatsforthepath.
SilkTestinstallstheapponthemobiledeviceoremulator.
11.
ClickOK.
AnAndroiddeviceoremulatormustnotbescreen-lockedduringtesting.
Tokeepthedeviceawakewhileitisconnectedtoamachine,openthesettingsandtapDeveloperOptions.
ThencheckStayawakeorStayawakewhilecharging.
12.
UsetheRecordingwindowtorecordthetestagainstthemobileapplication.
Foradditionalinformation,seeRecordingMobileApplications.
13.
Whenyouhaverecordedalltheactions,stoptherecording.
14.
Replaythetest.
15.
Analyzethetestresults.
TestingHybridApplicationsonAndroidHybridapplications(apps)areappsthatarerunonthedevice,likenativeapplications,butarewrittenwithwebtechnologies,forexampleHTML5,CSS,andJavaScript.
SilkTestprovidesfullbrowsersupportfortestingdebughybridappsthatconsistofasinglewebview,whichisembeddedinanativecontainer.
AcommonexampleofsuchahybridappwouldbeanApacheCordovaapplication.
TestingMobileApplications|5Toprepareanon-debughybridappfortesting,enableremotedebuggingintheappbyaddingthefollowingcodetotheapp:WebView.
setWebContentsDebuggingEnabled(true);webView.
getSettings().
setJavaScriptEnabled(true);Totestnon-debughybridappswithoutremotedebuggingenabledorhybridappsthatincludemorethanonewebview,enabletheSilkTestfallbacksupportbysettingtheoptionOPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORTtoTRUE.
Foradditionalinformation,seeSettingAdvancedOptions.
Withthefallbacksupportenabled,SilkTestrecognizesandhandlesthecontrolsinawebviewasnativemobilecontrolsinsteadofbrowsercontrols.
Forexample,thefollowingcodeclicksonalinkwhenusingbrowsersupport:desktop.
setOption(CommonOptions.
OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT,false);desktop.
find("//INPUT[@id='email']").
click();Withthefallbacksupportenabled,thefollowingcodeclicksonthesamelink:desktop.
setOption(CommonOptions.
OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT,true);desktop.
find("//MobileTextField[@resource-id='email']").
click();SilkTestcandetectwebviewsthatsupportChromeremotedebugging.
SilkTestcandetectwebviewswitheitherthepackagecom.
android.
webvieworthepackagecom.
google.
android.
webview,whicharethedefaultpackagesonmostAndroiddevices.
Note:SilkTestsupportstestinghybridappsonAndroid4.
4orlater.
TotesthybridappsonAndroid,AndroidSystemWebViewversion51orlaterisrequired.
TheprocessfortestingahybridapponAndroidisthesameastheprocessfortestingamobilenativeapplication.
Foradditionalinformation,seeTestingMobileApplicationsonAndroid.
InstallingaUSBDriverToconnectanAndroiddeviceforthefirsttimetoyourlocalmachinetotestyourmobileapplications,youneedtoinstalltheappropriateUSBdriver.
Thedevicemanufacturermightprovideanexecutablewithallthenecessarydriversforthedevice.
Inthiscaseyoucanjustinstalltheexecutableonyourlocalmachine.
Ifthemanufacturerdoesnotprovidesuchanexecutable,youcaninstallasingleUSBdriverforthedeviceonthemachine.
ToinstalltheAndroidUSBdriver:1.
Downloadtheappropriatedriverforyourdevice.
Forexample,forinformationonfindingandinstallingaUSBdriverforaGoogleNexusdevice,seehttp://developer.
android.
com/tools/extras/oem-usb.
html.
6|TestingMobileApplications2.
ConnectyourAndroiddevicetoaUSBportonyourlocalmachine.
3.
FromyourdesktoporWindowsExplorer,right-clickComputerandselectManage.
4.
Intheleftpane,selectDeviceManager.
5.
Intherightpane,locateandexpandOtherdevice.
6.
Right-clickthedevicename,forexampleNexus5x,andselectUpdateDriverSoftware.
TheHardwareUpdateWizardopens.
7.
SelectBrowsemycomputerfordriversoftwareandclickNext.
8.
ClickBrowseandnavigatetothefoldertowhichyouhavedownloadedtheUSBdriver.
9.
SelecttheUSBdriver.
10.
ClickNexttoinstallthedriver.
EnablingUSB-DebuggingTocommunicatewithanAndroiddeviceovertheAndroidDebugBridge(adb),enableUSBdebuggingonthedevice.
1.
OntheAndroiddevice,openthesettings.
2.
TapDeveloperSettings.
Thedevelopersettingsarehiddenbydefault.
Ifthedevelopersettingsarenotincludedinthesettingsmenuofthedevice:a)Dependingonwhetherthedeviceisaphoneorapad,scrolldownandtapAboutphoneorAboutPad.
b)ScrolldownagainandtapBuildNumberseventimes.
3.
IntheDevelopersettingswindow,checkUSB-Debugging.
4.
SettheUSBmodeofthedevicetoMediadevice(MTP),whichisthedefaultsetting.
Foradditionalinformation,refertothedocumentationofthedevice.
RecommendedSettingsforAndroidDevicesTooptimizetestingwithSilkTest,configurethefollowingsettingsontheAndroiddevicethatyouwanttotest:EnableUSB-debuggingontheAndroiddevice.
Foradditionalinformation,seeEnablingUSB-DebuggingAnAndroiddevicemustbeconnectedasamediadevicetothemachineonwhichtheOpenAgentisrunning.
TheUSBmodeoftheAndroiddevicemustbesettoMediadevice(MTP).
AnAndroiddeviceoremulatormustnotbescreen-lockedduringtesting.
Tokeepthedeviceawakewhileitisconnectedtoamachine,openthesettingsandtapDeveloperOptions.
ThencheckStayawakeorStayawakewhilecharging.
ConfiguringtheAndroidEmulatorforSilkTestWhenyouwanttotestmobileapplicationsonanAndroidemulatorwithSilkTest,youhavetoconfiguretheemulatorfortesting:1.
InstallthelatestversionoftheAndroidSDK.
ForinformationonhowtoinstallandconfiguretheAndroidSDK,seeGettheAndroidSDK.
2.
InstallAndroidStudio2.
Tip:YoucanskipinstallingAndroidStudio2andusetheemulatorprovidedwiththeAndroidSDK.
However,MicroFocusrecommendsinstallingAndroidStudio2forimprovedemulatorperformance.
TheremainingstepsinthistopicrequireAndroidStudio2tobeinstalled.
3.
FromAndroidStudio2,starttheAVDManager.
TestingMobileApplications|74.
ClickCreateVirtualDevice.
5.
Selectavirtualdevice.
6.
ClickNext.
7.
DownloadandselectasystemimageofAndroidthatincludesGoogleAPIs.
8.
ClickNext.
9.
Configurethevirtualdeviceaccordingtoyourrequirements.
10.
ClickShowAdvancedSettings.
11.
AdjusttheRAMsizeandtheheapspaceusedbytheemulatortoanamountthatismanageablebyyourmachine.
Tip:MicroFocusrecommendsusingatleast1GBRAMand256MBheapspace.
12.
SelectAutofromthelistintheEmulatedPerformancearea.
13.
ClickFinish.
TestedConfigurationsforParallelTestExecutionWithSilkTest,youcanrunautomatedtestsonmultipleAndroiddevicesinparallel.
TheamountofAndroiddevicesthatyouareabletouseinparalleldependsontheavailablehardware.
MicroFocushassuccessfullytestedthefollowinghardwareconfigurations:8|TestingMobileApplicationsConfigurationwithasingletestmachineUsingasingletestmachinedirectlyconnectedtotheAndroiddevicesthroughUSB,wetestedupto8physicalAndroiddevicesinparallel.
ThetestmachinewasaLenovoThinkPadT450withthefollowinghardwarespecifications:IntelCorei7-5600UCPU@2.
60GHz2cores(4threads)8GBRAMConfigurationwithtwotestmachinesHereweareusingtwotestmachines,onewithSilkTestinstalledandanother,whichisconfiguredasaremotelocationforthefirstmachineandhastheSilkTestInformationServiceinstalled.
Usingsuchaconfiguration,wetestedupto10physicalAndroiddevicesinparallel.
Testmachine1wasaLenovoThinkPadT450withthefollowinghardwarespecifications:IntelCorei7-5600UCPU@2.
60GHz2cores(4threads)8GBRAMTestmachine2wasaDellPrecisionT1700withthefollowinghardwarespecifications:TestingMobileApplications|9IntelCorei7-4770CPU@3.
40GHz4cores(8threads)16GBRAMConfigurationwithaWindowsmachineandaMacHereweareusingtwotestmachines,aWindowsmachinewithSilkTestinstalledandaMac,whichisconfiguredasaremotelocationforthefirstmachineandhastheSilkTestInformationServiceinstalled.
Usingsuchaconfiguration,wetestedupto10physicalAndroiddevicesinparallel.
Testmachine1wasaLenovoThinkPadT450withthefollowinghardwarespecifications:IntelCorei7-5600UCPU@2.
60GHz2cores(4threads)8GBRAMTestmachine2wasanAppleMacMiniwiththefollowinghardwarespecifications:IntelCorei5-4782UCPU@2.
60GHz2cores(4threads)16GBRAMiOSSilkTestenablesyoutotestamobileapplicationonaniOSdeviceoraniOSSimulator.
BecauseofsignificantchangesbyAppleiniOS9.
3incomparisontothepreviousversionsofiOS,SilkTestsupportstestingmobileapplicationsoniOS9.
3orlater.
ForalistofthesupportediOSversions,refertotheReleaseNotes.
Tip:TotestonpriorversionsofiOS,youcanuseSilkTest17.
5.
ThefollowingtableshowsthemajorchangeswhentestingoniOSwithSilkTest18.
0incomparisontoSilkTest17.
5:10|TestingMobileApplicationsSilkTest18.
0SilkTest17.
5SupportsiOS9.
3andiOS10.
SupportsiOS8.
1,8.
2,8.
3,8.
4,9.
0,9.
1,9.
2,and9.
3SupportsXcode8.
3.
SupportsXcode6andXcode7.
SupportstestingmultiplephysicaliOSdevicesinthesameusersession.
Tip:IfyouhavecreatedmultipleusersessionstotestwithSilkTest17.
5,MicroFocusrecommendsremovingallusersessionsexceptone.
RequiresmultipleusersessionsonaMactotestmultiplephysicaliOSdevices.
PrerequisitesforTestingMobileApplicationsoniOSBeforeyoucantestamobileapplication(app)onaniOSdeviceoronaniOSSimulator,ensurethatthefollowingprerequisitesaremet:ThecurrentversionoftheSilkTestinformationserviceisinstalledontheMac.
Foradditionalinformation,seeInstallingtheSilkTestInfoserviceonaMac.
IfyouwanttotestyourapplicationonaphysicaliOSdevice,ensurethefollowing:ThedeviceisconnectedtotheMac.
ThedevicehasasupportedversionofiOS.
ForalistofthesupportediOSversions,refertotheReleaseNotes.
IfyouwanttotestyourapplicationonaniOSSimulator,ensurethefollowing:TheiOSSimulatorimageisinstalledontheMac.
TheiOSSimulatorimagehasasupportedversionofiOS.
ForalistofthesupportediOSversions,refertotheReleaseNotes.
IfyouwanttotestyourapplicationonanphysicaliOSdevice,ensurethatthesametimezoneissetonthedeviceandtheMac.
AsupportedversionofXcodeisinstalledontheMac.
SilkTestisinstalledonaWindowsmachine.
TheMacislocatedinthesamenetworkastheWindowsmachineandisaddedasaremotelocationtotheWindowsmachine.
TotestanativemobileapponaniOSdevice,ensurethatthe.
ipafileofyourapphasbeensignedwithadeveloperaccount.
Foradditionalinformation,seePreparinganiOSAppforTesting.
TotestanativemobileapponaniOSSimulator,ensurethattheapphasbeenzipped.
Foradditionalinformation,seeTestingNativeMobileApplicationsonaniOSSimulator.
TotestanativemobileapponbothaniOSdeviceandaniOSSimulator,ensurethatboththesigned.
ipafileandthezipped.
appdirectoryarelocatedinthesamefolder.
Totestanativemobileapp,ensurethattheIDoftheiOSdeviceisassociatedwiththedeveloperprofilewhichwasusedtosigntheapp.
TheiOSdevicemustnotfallintosleepmodeduringtesting.
Toturnthescreenlockandpasswordoff,selectSettings>General>PasscodeLock.
TheMacshouldnotswitchoffthescreenduringtesting,otherwisethePlaybackStatusdialogboxwillnotdisplayanything.
TotestamobileapplicationonaniOSSimulator,deactivatethedisplaysleepontheMacduringtesting.
TotestanativemobileapponaphysicaliOSdevice,enabletheUIautomationonthedevice.
Foradditionalinformation,seePreparinganiOSDeviceforTesting.
TotestamobilewebapplicationwithAppleSafarionaphysicaliOSdevice,activatetheWebInspector.
Foradditionalinformation,seePreparinganiOSDeviceforTesting.
MicroFocusrecommendsusingiOSdeviceswhichhaveaLightningconnector.
SilkTestdoesnotsupportshowingaliveviewofthedevicescreenforiOSdevicesthatarenotconnectedtoaMacthroughaLightningcable.
TestingMobileApplications|11TestingNativeMobileApplicationsonaPhysicaliOSDeviceNote:TotestnativemobileapplicationsorhybridapplicationswithSilkTest,yourequireanativemobilelicense.
Foradditionalinformation,seeLicensingInformation.
ForinformationontheprerequisitesfortestingmobileapplicationsoniOS,seePrerequisitesforTestingMobileApplicationsoniOS.
Forinformationontheknownlimitationswhentestingnativemobileapplications,seeLimitationsforTestingMobileNativeApplications.
Totestanativemobileapplication(app)orahybridapplicationonaphysicaliOSdevice,performthefollowingtasks:1.
PreparetheiOSdevicefortesting.
Foradditionalinformation,seePreparinganiOSDeviceforTesting.
2.
Preparetheappfortesting.
Foradditionalinformation,seePreparinganiOSAppforTesting.
3.
PreparetheMacfortesting.
Foradditionalinformation,seePreparingaMacforTestingMobileApplicationsoniOS.
4.
AddtheMac,towhichtheiOSdeviceisconnected,asaremotelocationtotheWindowsmachineonwhichSilkTestisinstalled.
Foradditionalinformation,seeEditingRemoteLocations.
Note:Atanygivenpointintime,youcantestonmultiplephysicaliOSdevicesthatareconnectedtotheMac,butonlyononeiOSSimulatorthatisrunningontheMac.
WithSilkTest17.
5Hotfix1orlater,youarenolongerrequiredtousemultipleusersessionsonaMactotestmobileapplicationsoniOS.
5.
CreateaSilkTestprojectforyourmobileapplication.
6.
Createatestforyourmobileapplication.
7.
Recordtheactionsthatyouwanttoexecuteinthetest.
WhenyoustarttheRecordingwindow,theSelectApplicationdialogboxopens.
8.
SelecttheMobiletab.
9.
Selectthemobiledevice,onwhichyouwanttotesttheapp,fromthelist.
10.
ClickBrowsetoselecttheappfileorenterthefullpathtotheappfileintotheMobileappfiletextfield.
SilkTestsupportsHTTPandUNCformatsforthepath.
SilkTestinstallstheapponthemobiledevice.
11.
ClickOK.
AniOSdeviceorSimulatormustnotfallintosleepmodeduringtesting.
Toturnthescreenlockandpasswordoff,selectSettings>General>PasscodeLock.
12.
Whenyouhaverecordedallactions,stoprecording.
13.
Replaythetest.
14.
Analyzethetestresults.
Note:TotestanativemobileapponbothaniOSdeviceandaniOSSimulator,ensurethatboththesigned.
ipafileandthezipped.
appdirectoryarelocatedinthesamefolder.
12|TestingMobileApplicationsTestingNativeMobileApplicationsonaniOSSimulatorNote:TotestnativemobileapplicationsorhybridapplicationswithSilkTest,yourequireanativemobilelicense.
Foradditionalinformation,seeLicensingInformation.
ForinformationontheprerequisitesfortestingmobileapplicationsoniOS,seePrerequisitesforTestingMobileApplicationsoniOS.
Forinformationontheknownlimitationswhentestingnativemobileapplications,seeLimitationsforTestingMobileNativeApplications.
Totestanativemobileapplication(app)orahybridapplicationonaniOSSimulator,performthefollowingtasks:1.
PreparetheMacfortesting.
Foradditionalinformation,seePreparingaMacforTestingMobileApplicationsoniOS.
2.
IntheXcodeprojectoftheapp,compiletheappfortheiOSSimulator.
YoucancompiletheappeitherfromtheXcodeUIorfromthecommandline.
Forexample,tocompiletheappthroughthecommandlineforaniOSSimulatorwithiOS10.
0,executethefollowingcommand:xcodebuild-sdkiphonesimulator10.
03.
Zipupthe.
appdirectoryoftheappintoa.
zipfile.
Bydefault,the.
appdirectoryislocatedinthedirectory~/Library/Developer/Xcode/DerivedData.
YoucanclickFile>ProjectSettingsinXcodetoseeintowhichlocationthedirectoryisstored.
4.
AddtheMac,onwhichtheiOSSimulatorisinstalled,asaremotelocationtotheWindowsmachineonwhichSilkTestisinstalled.
Foradditionalinformation,seeEditingRemoteLocations.
Note:YoucanonlytestononeiOSSimulatorthatisinstalledonaMac.
MultipleSilkTestuserscannotsimultaneouslytestonmultipleiOSSimulatorsthatareinstalledonthesameMac.
5.
CreateaSilkTestprojectforyourmobileapplication.
6.
Createatestforyourmobileapplication.
7.
Recordtheactionsthatyouwanttoexecuteinthetest.
WhenyoustarttheRecordingwindow,theSelectApplicationdialogboxopens.
8.
SelecttheMobiletab.
9.
SelecttheiOSSimulatorfromthelist.
10.
ClickBrowsetoselectthezippedappfileorenterthefullpathtothezippedappfileintotheMobileappfiletextfield.
SilkTestsupportsHTTPandUNCformatsforthepath.
SilkTestinstallstheappontheiOSSimulator.
11.
ClickOK.
AniOSdeviceorSimulatormustnotfallintosleepmodeduringtesting.
Toturnthescreenlockandpasswordoff,selectSettings>General>PasscodeLock.
12.
Whenyouhaverecordedallactions,stoprecording.
13.
Replaythetest.
14.
Analyzethetestresults.
Note:TotestanativemobileapponbothaniOSdeviceandaniOSSimulator,ensurethatboththesigned.
ipafileandthezipped.
appdirectoryarelocatedinthesamefolder.
TestingMobileApplications|13TestingMobileWebApplicationsonaPhysicaliOSDeviceForinformationontheprerequisitesfortestingmobileapplicationsoniOS,seePrerequisitesforTestingMobileApplicationsoniOS.
Forinformationontheknownlimitationswhentestingmobilewebapplications,seeLimitationsforTestingMobileWebApplications.
TotestamobilewebapplicationonaphysicaliOSdevice,performthefollowingtasks:1.
PreparetheiOSdevicefortesting.
Foradditionalinformation,seePreparinganiOSDeviceforTesting.
2.
PreparetheMacfortesting.
Foradditionalinformation,seePreparingaMacforTestingMobileApplicationsoniOS.
3.
AddtheMac,towhichtheiOSdeviceisconnected,asaremotelocationtotheWindowsmachineonwhichSilkTestisinstalled.
Foradditionalinformation,seeEditingRemoteLocations.
Note:Atanygivenpointintime,youcantestonmultiplephysicaliOSdevicesthatareconnectedtotheMac,butonlyononeiOSSimulatorthatisrunningontheMac.
WithSilkTest17.
5Hotfix1orlater,youarenolongerrequiredtousemultipleusersessionsonaMactotestmobileapplicationsoniOS.
4.
CreateaSilkTestprojectforyourmobileapplication.
5.
Createatestforyourmobileapplication.
6.
Recordtheactionsthatyouwanttoexecuteinthetest.
WhenyoustarttheRecordingwindow,theSelectApplicationdialogboxopens.
7.
Totestamobilewebapplication:a)SelecttheWebtab.
b)Selectthemobilebrowserthatyouwanttouse.
c)SpecifythewebpagetoopenintheEnterURLtonavigatetextbox.
8.
ClickOK.
AniOSdeviceorSimulatormustnotfallintosleepmodeduringtesting.
Toturnthescreenlockandpasswordoff,selectSettings>General>PasscodeLock.
9.
Whenyouhaverecordedallactions,stoprecording.
10.
Replaythetest.
11.
Analyzethetestresults.
TestingMobileWebApplicationsonaniOSSimulatorForinformationontheknownlimitationswhentestingmobilewebapplications,seeLimitationsforTestingMobileWebApplications.
TotestamobilewebapplicationonaniOSSimulator,performthefollowingtasks:1.
PreparetheMacfortesting.
Foradditionalinformation,seePreparingaMacforTestingMobileApplicationsoniOS.
2.
AddtheMac,onwhichtheiOSSimulatorisinstalled,asaremotelocationtotheWindowsmachineonwhichSilkTestisinstalled.
Foradditionalinformation,seeEditingRemoteLocations.
Note:Atanygivenpointintime,youcantestonmultiplephysicaliOSdevicesthatareconnectedtotheMac,butonlyononeiOSSimulatorthatisrunningontheMac.
WithSilkTest17.
5Hotfix114|TestingMobileApplicationsorlater,youarenolongerrequiredtousemultipleusersessionsonaMactotestmobileapplicationsoniOS.
3.
CreateaSilkTestprojectforyourmobileapplication.
4.
Createatestforyourmobileapplication.
5.
Recordtheactionsthatyouwanttoexecuteinthetest.
WhenyoustarttheRecordingwindow,theSelectApplicationdialogboxopens.
6.
Totestamobilewebapplication:a)SelecttheWebtab.
b)Selectthemobilebrowserthatyouwanttouse.
c)SpecifythewebpagetoopenintheEnterURLtonavigatetextbox.
7.
ClickOK.
AniOSdeviceorSimulatormustnotfallintosleepmodeduringtesting.
Toturnthescreenlockandpasswordoff,selectSettings>General>PasscodeLock.
8.
Whenyouhaverecordedallactions,stoprecording.
9.
Replaythetest.
10.
Analyzethetestresults.
TestingHybridApplicationsoniOSHybridapplications(apps)areappsthatarerunonthedevice,likenativeapplications,butarewrittenwithwebtechnologies,forexampleHTML5,CSS,andJavaScript.
SilkTestprovidesfullbrowsersupportfortestingdebughybridappsthatconsistofasinglewebview,whichisembeddedinanativecontainer.
AcommonexampleofsuchahybridappwouldbeanApacheCordovaapplication.
Totestnon-debughybridappswithoutremotedebuggingenabledorhybridappsthatincludemorethanonewebview,enabletheSilkTestfallbacksupportbysettingtheoptionOPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORTtoTRUE.
Foradditionalinformation,seeSettingAdvancedOptions.
Withthefallbacksupportenabled,SilkTestrecognizesandhandlesthecontrolsinawebviewasnativemobilecontrolsinsteadofbrowsercontrols.
Forexample,thefollowingcodeclicksonalinkwhenusingbrowsersupport:desktop.
setOption(CommonOptions.
OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT,false);desktop.
find("//INPUT[@id='email']").
click();Withthefallbacksupportenabled,thefollowingcodeclicksonthesamelink:desktop.
setOption(CommonOptions.
OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT,true);desktop.
find("//MobileTextField[@resource-id='email']").
click();TestingMobileApplications|15TheprocessfortestingahybridapponiOSisthesameastheprocessfortestingamobilenativeapplication.
Foradditionalinformation,seeTestingNativeMobileApplicationsonaPhysicaliOSDeviceorTestingNativeMobileApplicationsonaniOSSimulator.
BeforetestingahybridapponaniOSdevice,ensurethattheWebInspectorisactivatedonthedevice.
PreparinganiOSDeviceforTestingNote:TotestnativemobileapplicationsorhybridapplicationswithSilkTest,yourequireanativemobilelicense.
Foradditionalinformation,seeLicensingInformation.
TopreparetheiOSdevicetotestmobileapplications:1.
StartXcodeontheMac.
2.
ConnecttheiOSdevicetotheMac.
3.
OntheiOSdevice,clickSettings>Developer.
Tip:IftheDevelopermenuisnotdisplayedontheiOSdevice,restartthedeviceandtheMac.
4.
ActivateEnableUIAutomation.
5.
TotestamobilewebapplicationonAppleSafari,clickSettings>Safari>Advanced.
6.
ActivatetheWebInspector.
PreparinganiOSAppforTestingTobeabletotestaspecificiOSapponaspecificiOSdevicewithSilkTest,considerthefollowing:TestautomationisonlypossiblewithiOSappsthatcanbeinstalledmanuallyonspecificiOSdevices.
TobeabletosignaniOSapp,yourequireamembershipintheAppleDeveloperProgram.
Foradditionalinformation,seeChoosingaMembership.
TotestwithouthavingamembershipintheAppleDeveloperProgram,seeUsingaPersonalTeamProfileforTestingonPhysicaliOSDevices.
Note:YoucannotautomaticallytestiOSappsthatarecreatedforpublicationintheAppStore,aswellasappsthatcanbeinstalledmanuallyonanyiOSdevice.
BeforeyoucaninstallandexecuteaniOSapponaspecificiOSdevice,youhavetoregistertheiOSdevicewithyourAppleDeveloperaccount.
YouhavetouseXcodetocreateanIPAfileoftheiOSapp,whichyoucantheninstallontheiOSdevice.
TocreateIPAfilesfortestingonaspecificiOSdevice,membersoftheAppleDeveloperProgramcanusetheArchivemechanismofXcode,byusingoneofthefollowingtwooptions:IfyouareamemberoftheAppleDeveloperEnterpriseProgram,youcanusetheSaveforAdHocDeploymentoption.
IfyouareamemberoftheAppleDeveloperProgram,butnotoftheAppleDeveloperEnterpriseProgram,youcanusetheSaveforDevelopmentDeploymentoption.
Foradditionalinformation,seeExportingYourAppforTesting(iOS,tvOS,watchOS).
TobeabletotestaspecificiOSapponaniOSSimulatorwithSilkTest,useXcodetocreateaZIPfileoftheiOSapp,whichyoucantheninstallontheiOSSimulator.
Foradditionalinformation,refertotheXcodedocumentation.
InstallingtheSilkTestInformationServiceonaMacNote:ToinstalltheinformationserviceonaMac,yourequireadministrativeprivilegesontheMac.
TocreateandexecutetestsagainstAppleSafarionaMac,oragainstmobileapplicationsonaniOSorAndroiddevicethatisconnectedtoaMac,installtheSilkTestinformationservice(informationservice)on16|TestingMobileApplicationstheMac,andthenusetheRemoteLocationsdialogboxtoconnectaWindowsmachine,onwhichSilkTestisinstalled,totheMac.
ToinstalltheinformationserviceonaMac:1.
EnsurethataJavaJDKisinstalledontheMac.
2.
IfyouwanttotestmobileapplicationsonaniOSdevice,ensurethatXcodeisinstalledontheMac.
3.
Accesstheinformationservicesetupfile,SilkTestInformationService-.
pkg.
IfyouhavedownloadedtheinformationservicesetupfilewhileinstallingSilkTest,openthefoldermacOSintheSilkTestinstallationdirectory,forexampleC:\ProgramFiles(x86)\Silk\SilkTest.
IfyouhavenotdownloadedtheinformationservicesetupfilewhileinstallingSilkTest,youcandownloadthesetupfilefromMicroFocusSupportLine.
4.
CopythefileSilkTestInformationService-.
pkgtotheMac.
5.
ExecuteSilkTestInformationService-.
pkgtoinstalltheinformationservice.
6.
Followtheinstructionsintheinstallationwizard.
7.
Whenaskedforthepassword,providethepasswordofthecurrentlysignedinMacuser.
8.
WhenAppleSafariopensandamessageboxaskswhethertotrusttheSafariDriver,clickTrust.
Note:YoucanonlyinstalltheSafariDriverifyouaredirectlyloggedintotheMac,andnotconnectedthrougharemoteconnection.
Tocompletetheinstallation,theinstallerlogsthecurrentMacuserout.
Toverifythattheinformationservicewasinstalledcorrectly,logintotheMacandclickontheSilkTesticoninthetop-rightcornerofthescreentoseetheavailabledevicesandbrowsers.
Tip:IftheSilkTesticondoesnotappear,restarttheMac.
PreparingaMactoTestMobileApplicationsoniOSNote:TotestnativemobileapplicationsorhybridapplicationswithSilkTest,yourequireanativemobilelicense.
Foradditionalinformation,seeLicensingInformation.
TotestmobileapplicationsoniOS,yourequireaMactowhichyoucanconnecttheiOSdevice,oronwhichtheiOSSimulatorisrunning.
ThisMacrequiresXcodetobeinstalled.
ForadditionalinformationontheprerequisitesfortestingmobileapplicationsoniOS,seePrerequisitesforTestingMobileApplicationsoniOS.
ToexecuteiOStestsonaphysicaliOSdevice,followtheinstructionsintheSilkTestConfigurationAssistanttoconfiguretheWebDriverAgentRunnerXcodeproject.
ToopentheConfigurationAssistant,clickontheSilkTesticoninthestatusmenusandselectConfigurationAssistant.
IfforanyreasonyouwanttomanuallybuildtheWebDriverAgentRunnerXcodeproject,performthefollowingactions:1.
StartXcodeontheMac.
2.
SelectXcode>Preferences.
TestingMobileApplications|173.
InthePreferenceswindow,selectyouraccount.
a)SelecttheAccountstab.
b)ChooseyourAppleID.
c)ChooseyourTeam.
d)ClickViewDetails.
4.
AccesstheAppleMemberCenterandretrieveyourlatestprovisioningprofileidandyourdevelopmentteam.
5.
Fromthefilenameofthe.
mobileprovisionfile,copytheprovisioningprofileID.
Note:TheprovisioningprofileIDis36characterslong,andisthefilenamewithoutthefileextension.
6.
Inaterminal,navigateto~/.
silk/silktest/conf/.
7.
Renamethexcconfigfiletemplatesilktest.
xcconfig.
sampletosilktest.
xcconfig.
8.
Addyourdevelopmentteamtothesilktest.
xcconfigfile.
DEVELOPMENT_TEAM=9.
ExecutethefollowingcommandsinaterminalontheMactoverifythatyouhavepreparedtheWebDriverAgentRunnerprojectcorrectly:18|TestingMobileApplicationsa)Determinetheuniquedeviceid(udid)ofyourphysicaliOSdevice:idevice_id-lb)NavigatetotheWebDriverAgentRunnerproject:cd/Application/Silk/Mobile/common/Appium/node_modules/appium-xcuitest-driver/WebDriverAgentc)TestthattheWebDriverAgentcanbebuilt:xcodebuild-projectWebDriverAgent.
xcodeproj-schemeWebDriverAgentRunner–xcconfig~/.
silk/silktest/conf/silktest.
xcconfig-destination'id='testReplacethewiththeuniquedeviceidthatyouhavedeterminedpreviously.
Tip:Ifthexcodebuildcommandfails,followtheinstructionsintheerrormessage.
Additionally,openthePreferenceswindowoftheWebDriverAgentRunnerprojectandensurethattheAutomaticallymanagesigningcheckboxintheGeneraltabisnotchecked.
10.
Optional:Intheinfoservice.
propertiesfile,youcanspecifytheportfortheSilkTestInformationServiceorcapabilitieswhichareusedduringalltestrunsontheMac.
Foradditionalinformation,seeEditingthePropertiesoftheSilkTestInformationService.
UsingaPersonalTeamProfileforTestingonPhysicaliOSDevicesIfyouhavenomembershipintheAppleDeveloperProgram,youcanuseapersonalteamprofiletotestanapplicationonaphysicaliOSdevice:1.
OntheMac,navigateto/Application/Silk/Mobile/common/Appium/node_modules/appium-xcuitestdriver/WebDriverAgent.
2.
OpenWebDriverAgent.
xcodeprojprojectinXcode.
3.
FromtheTARGETSlist,selecttheWebDriverAgentLibtarget:a)ClicktheGeneraltab.
b)SelectAutomaticallymanagesigning.
c)Selectyourdevelopmentteam.
TheSigningCertificateisautomaticallyselected.
4.
FromtheTARGETSlist,selecttheWebDriverAgentRunnertarget:a)ClicktheGeneraltab.
b)SelectAutomaticallymanagesigning.
c)Selectyourdevelopmentteam.
TheSigningCertificateisautomaticallyselected.
5.
IfXcodefailstocreateaprovisioningprofilefortheWebDriverAgentRunnertarget,manuallychangethebundleidforthetarget.
a)ClicktheBuildSettingstab.
b)ChangetheProductBundleIdentifiertosomethingthatXcodeaccepts.
Forexample,iftheProductBundleIdentifieriscom.
facebook.
WebDriverAgentRunner,changeittoio.
appium.
WebDriverAgentRunnerorio.
borland.
WebDriverAgentRunner.
c)ClicktheGeneraltab.
Thetargetshouldnowhaveaprovisioningprofile.
6.
SavetheWebDriverAgent.
xcodeprojproject.
7.
Toverifythateverythingworksasexpected,buildtheproject:xcodebuild-projectWebDriverAgent.
xcodeproj-schemeWebDriverAgentRunner-destination'id='testIPHONEOS_DEPLOYMENT_TARGET=10.
3TestingMobileApplications|19AlthoughtheWebDriverAgentRunnerissuccessfullyinstalledonthedevice,anerrormessagelikethefollowingmightappearintheconsoleortheAppiumlogfiles:2017-01-2409:02:18.
358xcodebuild[30385:339674]ErrorDomain=com.
apple.
platform.
iphoneosCode=-12"Unabletolaunchcom.
apple.
test.
WebDriverAgentRunner-Runner"UserInfo={NSLocalizedDescription=Unabletolaunchcom.
apple.
test.
WebDriverAgentRunner-Runner,NSUnderlyingError=0x7fa839cadc60{ErrorDomain=DTXMessageCode=1"(null)"UserInfo={DTXExceptionKey=Theoperationcouldn'tbecompleted.
Unabletolaunchcom.
apple.
test.
WebDriverAgentRunner-Runnerbecauseithasaninvalidcodesignature,inadequateentitlementsoritsprofilehasnotbeenexplicitlytrustedbytheuser.
:Failedtolaunchprocesswithbundleidentifier'com.
apple.
test.
WebDriverAgentRunner-Runner'}}}2017-01-2409:02:18.
358xcodebuild[30385:339674]ErrorDomain=IDETestOperationsObserverErrorDomainCode=5"Earlyunexpectedexit,operationneverfinishedbootstrapping-norestartwillbeattempted"UserInfo={NSLocalizedDescription=Earlyunexpectedexit,operationneverfinishedbootstrapping-norestartwillbeattempted}Testingfailed:TesttargetWebDriverAgentRunnerencounteredanerror(Earlyunexpectedexit,operationneverfinishedbootstrapping-norestartwillbeattempted)Theproblemisthatthedeveloperisnottrustedonthedevice.
IfyoumanuallytrytoruntheWebDriverAgentRunnerapponthedevice,youwillseeanUntrustedDevelopermessage.
Tosolvethisissueonthedevice,gotoSettings>General>ProfilesorSettings>General>DeviceManagement,dependingonthedevicetypeandtheiOSversion.
ThentrustthedeveloperandallowtheWebDriverAgentRunnerapptoberun.
EditingthePropertiesoftheSilkTestInformationServiceYoucanusetheinfoservice.
propertiesfiletospecifytheportfortheSilkTestInformationServiceorvariouscapabilities.
ThesecapabilitiesareappliedeachtimeSilkTestexecutesatestonthemachineonwhichtheSilkTestInformationServiceisrunning.
1.
Navigatetothedirectoryinwhichtheinfoservice.
properties.
samplefileislocated.
Forexample,onaMac,navigateto~/.
silk/silktest/conf/.
OnaWindowsmachine,navigatetoC:\ProgramData\Silk\SilkTest\conf.
2.
Renamethefileinfoservice.
properties.
sampletoinfoservice.
properties.
3.
Specifyaportthatisnotinuse.
ThedefaultportfortheSilkTestInformationServiceis22901.
4.
Tospecifycapabilities,addthefollowinglinetotheinfoservice.
propertiesfile:customCapabilities=;;.
.
.
Example:RunninganiOSSimulatorinaSpecifiedLanguageToalwaysrunaspecificiOSSimulatoronaMacinthesamelanguage,forexampleJapanese,specifythecustomcapabilitieslanguageandlocale.
Todoso,addthefollowinglinetotheinfoservice.
propertiesfile:customCapabilities=language=ja;locale=ja_JPUninstallingtheSilkTestInformationServicefromaMacTouninstalltheSilkTestinformationservice(informationservice)fromaMac,forexampleifyounolongerwanttoexecutetestsagainstAppleSafariontheMac:1.
Createanewshellfile,forexampleuninstallInfoService.
sh.
20|TestingMobileApplications2.
Typethefollowingcodeintothenewfile:#!
/bin/shiflaunchctllist|grepcom.
borland.
infoservice;thenlaunchctlunload/Library/LaunchAgents/com.
borland.
infoservice.
plistecho"unloadingLaunchDaemon"fiif[-d"/Applications/Silk"]thensudorm-rf/Applications/Silkfiif[-f"/Library/LaunchAgents/com.
borland.
infoservice.
plist"]thensudorm/Library/LaunchAgents/com.
borland.
infoservice.
plistfiif[-f"/usr/local/bin/ideviceinstaller"]thensudorm/usr/local/bin/ideviceinstallerfiexit03.
Inthecommandline,typechmod+xuninstallInfoService.
shtomaketheshellfileexecutable.
4.
Executetheshellfilefromthecommandline.
RecommendedSettingsforiOSDevicesTooptimizetestingwithSilkTest,configurethefollowingsettingsontheiOSdevicethatyouwanttotest:Tomakethetestingreflecttheactionsanactualuserwouldperform,disableAutoFillandrememberingpasswordsforAppleSafari.
TapSettings>Safari>Passwords&AutoFillandturnofftheNamesandPasswordssetting.
TheiOSdevicemustnotfallintosleepmodeduringtesting.
Toturnthescreenlockandpasswordoff,selectSettings>General>PasscodeLock.
RunningExistingScriptsoniOSUsingXCUITestAttention:PriorSilkTestversionsusedInstrumentstoautomateiOSdevices.
WithiOS9.
3,ApplehasreplacedthesupportforInstrumentswithsupportfortheXCUITestframework,causingSilkTesttoalsonolongersupportInstruments.
Becauseofthischange,existingiOStestscriptsmightbreakwhenexecutedfromthecurrentversionofSilkTest.
ThebehavioroftheclassnameattributeinXCUITestisdifferenttothebehaviorinInstruments.
Inmostcases,SilkTestwillautomaticallyhandlethischange.
However,ifanexistingtestscriptbreaksbecauseofsuchaclassnameattribute,youwillhavetorecordanewlocatorforthecorrespondingobject.
Theobjecthierarchyhaschanged.
TestinganInstalledAppTotestanativemobileappthatisalreadyinstalledonadevice,anEmulator,oraSimulator,specifytheappintheconnectionstring.
1.
Openanexistingprojectthattestsanativemobileapp.
2.
OpentheEditApplicationConfigurationdialogbox.
TestingMobileApplications|213.
Replacetheexistingappintheconnectionstringwithoneofthefollowing:IfyouwanttotestaniOSapp,replacetheappwiththebundleId,forexamplereplaceapp=MyApp.
ipawithbundleId=silktest.
InsuranceMobile.
IfyouwanttotestanAndroidapp,replacetheappwiththeappActivityandtheappPackage.
Forexample,replaceapp=MyApp.
apkwithappActivity=.
LoginActivity;appPackage=silktest.
insurancemobile.
Foradditionalinformation,seeConnectionString.
RecordingMobileApplicationsOnceyouhaveestablishedtheconnectionbetweenSilkTestandamobiledeviceoranemulator,youcanrecordtheactionsthatareperformedonthedevice.
Torecordmobileapplications,SilkTestusesaRecordingwindowthatprovidesthefollowingfunctionality:DisplaysthescreenofthemobiledeviceorAndroidemulatorwhichyouaretesting.
WhenyouperformanactionintheRecordingwindow,thesameactionisperformedonthemobiledevice.
Whenyouinteractwithacontrolonthescreen,theRecordingwindowpreselectsthedefaultaction.
IfthedefaultactionisaClick,andyouleft-clickonthecontrol,theactionisexecuted.
Youcanperformaright-clicktoshowalistoftheavailableactionsagainstthecontrol.
YoucanthenselecttheactionthatyouwanttoperformandclickOK.
IfthedefaultactionisnotaClick,alistofalltheavailableactionsagainstthecontroldisplays,andyoucanselecttheactionthatyouwanttoperformorsimplyacceptthepreselectedactionbyclickingOK.
Whenyouhaveselectedanactionfromthelist,youcantypevaluesfortheparametersoftheselectedactionintotheparameterfields.
SilkTestautomaticallyvalidatestheparameters.
Duringrecording,SilkTestdisplaysthemousepositionnexttotherecordingwindow.
Youcantogglethelocationtoswitchbetweendisplayingtheabsolutemousepositiononthedevicedisplayandthemousepositioninrelationtotheactiveobject.
Whenyoupausetherecording,youcanperformactionsinthescreenwhicharenotrecordedtobringthedeviceintoastatefromwhichyouwanttocontinuerecording.
Whenyoustoprecording,ascriptisgeneratedwithyourrecordedactions,andyoucanproceedwithreplayingthetest.
SelectingtheMobileDeviceforTestReplayYoucandefinethemobiledevicethatisusedforthereplayofatestinthefollowingways:IfyouexecuteascriptfromthecommandlineorfromaContinuousIntegration(CI)server,specifytheconnectionstringintheapplicationconfigurationofthescript.
IfyouexecuteatestfromSilkCentral,specifythemobiledeviceintheMobileDeviceSelectionareaoftheDeploymenttaboftheexecutiondefinitioninSilkCentralinsteadofspecifyingaconnectionstring.
Foradditionalinformation,refertotheSilkCentralHelp.
Youcanusetheconnectionstringtospecifyaspecificmobiledevice,oryoucanfilterasubsetoftheavailabledevices,forexampleifyouhaveadevicepool.
Thefirstmatchingdeviceisusedforreplay.
Ifnotspecifiedotherwise,mobiledevicesarematchedbyusingthefollowingrules,withdecliningpriority:Matchingmobiledevicesconnectedtothelocalmachinearepreferredovermobiledevicesconnectedtoremotelocations.
Ifthebrowsertypeisspecifiedintheconnectionstring,newerbrowserversionsarepreferredoverolderversions.
22|TestingMobileApplicationsNewerplatformsarepreferredoverolderplatforms.
AphysicaldeviceispreferredtoanEmulatororSimulator.
Adevicewithadevicenamethatisalphabeticallylaterispreferred.
Forexample,adevicenamed"iphone6"ispreferredtoadevicenamed"iphone5".
Example:ConnectionstringforanapponanAndroiddevicethatisconnectedtoaremotemachineTotesttheappMyApp.
apkonanAndroiddevicethatisconnectedtoaremotemachine,theconnectionstringwouldlooklikethefollowing:"platformName=Android;deviceName=MotoG3;host=http://10.
0.
0.
1;app=MyApp.
apk"Example:ConnectionstringforanapponaniOSSimulatoronaMac"platformName=iOS;platformVersion=10.
0;deviceName=iPhone6;host=10.
0.
0.
1;app=MyApp.
ipa;isSimulator=true"InteractingwithaMobileDeviceTointeractwithamobiledeviceandtoperformanactionlikeaswipeintheapplicationundertest:1.
IntheRecordingwindow,clickShowMobileDeviceActions.
Alltheactionsthatyoucanperformagainstthemobiledevicearelisted.
2.
Selecttheactionthatyouwanttoperformfromthelist.
3.
TorecordaswipeonanAndroiddeviceoremulator,movethemousewhileholdingdowntheleftmousebutton.
4.
Continuewiththerecordingofyourtest.
ReleasingaMobileDeviceWhenrecordingorplayingbackatestagainstamobiledevice,theOpenAgentinstancetakesownershipofthedevice.
Bydoingso,theOpenAgentispreventingotherSilkTestusersfromusingthedevice.
ToenableotherSilkTestuserstousethedeviceafteryouhavefinishedrecordingorreplayingtestsonthedevice,SilkTestautomaticallyreleasesthedevicewhentheSilkTestclientisclosed,whenanunattendedtestprocessfinishes,orwhentheOpenAgentisclosed.
Youcanalsomanuallyreleasethedevice.
Note:Releasingamobiledevicewillclosetheapplicationundertest(AUT)onthemobiledevice.
ReleasingaMobileDeviceAfterRecordingReleaseamobiledeviceafterrecordingtoenableotherSilkTestuserstotestonthedevice.
Toreleaseamobiledeviceafteryouhavefinishedrecording,performoneofthefollowingactions:StoptheOpenAgentfromtheSystemTray.
CloseSilkTest.
Thedeviceisonlyreleasedbythisactionwhenparalleltestingisenabled.
Note:Releasingamobiledevicewillclosetheapplicationundertest(AUT)onthemobiledevice.
TestingMobileApplications|23ReleasingaMobileDeviceAfterReplayReleaseamobiledeviceafterreplaytoenableotherSilkTestuserstotestonthedevice.
Tomanuallyreleaseamobiledeviceafterreplayingiscomplete,youcanalsoperformoneofthefollowing:Ifyouhavetestedamobilewebapplication,usetheClosemethodortheCloseSynchronmethodoftheBrowserApplicationclass.
Foradditionalinformationonthesemethods,refertotheAPIdocumentation.
webBrowser.
close();Ifyouhavetestedamobilenativeapplication,usetheCloseAppmethodoftheMobileDeviceclass.
Forexample,typethefollowing:MobileDevicemobileDevice=desktop.
find("//MobileDevice");mobileDevice.
closeApp();Addthedesktop.
detachAll()statementtothetestscript.
Amobiledeviceisautomaticallyreleasedifoneofthefollowingconditionsismet:TheOpenAgentisclosed.
Thetestprocessstopsduringunattendedtesting.
Thedeviceisonlyreleasedbythisactionwhenparalleltestingisenabled.
SilkTestisclosed.
Thedeviceisonlyreleasedbythisactionwhenparalleltestingisenabled.
Note:Releasingamobiledevicewillclosetheapplicationundertest(AUT)onthemobiledevice.
EditingRemoteLocationsYoucanusetheRemoteLocationsdialogboxtoaddanybrowsersandmobiledevicesonaremotelocationtothesetofapplicationsthatyoucantest.
1.
OpentheRemoteLocationsdialogbox.
IfyouareusingSilkTestWorkbench,clickTools>EditRemoteLocations.
IfyouareusingSilk4J,clickSilk4J>EditRemoteLocations.
IfyouareusingSilk4NET,clickSilk4NET>EditRemoteLocations.
IfyouareusingSilkTestClassic,clickOptions>EditRemoteLocations.
2.
Toaddanadditionalremotelocation,performthefollowingactions:a)ClickonthearrowtotherightofAddLocationtospecifywhetheryouwanttoaddaremotelocationwhichisusingtheSilkTestInformationService,orSilkCentral.
Note:YoucanonlyconfigureoneSilkCentralasaremotelocation.
IfyouhavealreadyconfiguredtheintegrationwithSilkCentral,SilkCentralislistedintheremotelocationslist.
b)ClickAddLocation.
TheAddLocationdialogboxappears.
c)TypetheURLoftheremotelocationandtheportthroughwhichSilkTestconnectstotheinformationserviceontheremotemachineintotheHostfield.
Thedefaultportis22901.
d)Optional:EditthenameoftheremotelocationintheNamefield.
3.
Toeditanexistingremotelocation,clickEdit.
4.
Toremovearemotelocation,clickRemove.
5.
Optional:ToreducetheamountofbrowsersanddevicesintheSelectApplicationdialog,clickDonotshowdevicesandbrowsersfromthislocation.
Theinstalledbrowsersandconnecteddevicesofthe24|TestingMobileApplicationsremotelocationwillnolongerbedisplayedintheSelectApplicationdialog.
Bydefault,allinstalledbrowsersandconnecteddevicesofallremotelocationsaredisplayedintheSelectApplicationdialog.
6.
ClickOK.
Whenyouhaveaddedaremotelocation,thebrowsersthatareinstalledontheremotelocation,includingAppleSafarionaMac,areavailableintheWebtaboftheSelectApplicationdialogbox,andthemobiledevicesthatareconnectedtotheremotelocationareavailableintheMobiletaboftheSelectApplicationdialogbox.
ConnectionStringforaMobileDeviceTheconnectionstringspecifieswhichmobiledeviceisusedfortesting.
Whenperformingmobiletesting,SilkTestusestheconnectionstringtoconnecttothemobiledevice.
Theconnectionstringistypicallypartoftheapplicationconfiguration.
Youcansettheconnectionstringwhenyouconfigureyourapplicationundertest.
Tochangetheconnectionstring,youcanusetheEditApplicationConfigurationdialogbox.
Note:IfyouexecuteatestfromSilkCentral,specifythemobiledeviceintheMobileDeviceSelectionareaoftheDeploymenttaboftheexecutiondefinitioninSilkCentralinsteadofspecifyingaconnectionstring.
Foradditionalinformation,refertotheSilkCentralHelp.
Youcanusetheconnectionstringtospecifyaspecificmobiledevice,oryoucanfilterasubsetoftheavailabledevices,forexampleifyouhaveadevicepool.
Thefirstmatchingdeviceisusedforreplay.
Ifnotspecifiedotherwise,mobiledevicesarematchedbyusingthefollowingrules,withdecliningpriority:Matchingmobiledevicesconnectedtothelocalmachinearepreferredovermobiledevicesconnectedtoremotelocations.
Ifthebrowsertypeisspecifiedintheconnectionstring,newerbrowserversionsarepreferredoverolderversions.
Newerplatformsarepreferredoverolderplatforms.
AphysicaldeviceispreferredtoanEmulatororSimulator.
Adevicewithadevicenamethatisalphabeticallylaterispreferred.
Forexample,adevicenamed"iphone6"ispreferredtoadevicenamed"iphone5".
Thefollowingcomponentsareavailablefortheconnectionstring:ComponentDescriptiondeviceNameThenameofthemobiledevice.
Whentestingonaphysicalmobiledevice,thedeviceIDcanbeusedinstead.
Supportswildcards.
Case-insensitive.
platformNameAndroidoriOS.
Required.
deviceIdOptional:TheIDofthemobiledevice.
Canbeusedinsteadofthedevicename,whentestingonaphysicalmobiledevice.
Supportswildcards.
Case-insensitive.
platformVersionOptional:TheAndroidoriOSversion.
SpecifytheversiontotestonlyonmobiledevicesthathaveaspecificAndroidoriOSversion.
Supportswildcards.
Case-insensitive.
browserVersionOptional:Canbeusedincombinationwiththebrowsertypetotestonlyonthespecifiedbrowserversion.
Supportswildcards.
Case-insensitive.
hostOptional:Ifnotset,anyspecifiedremotelocationcanbeusedasthehost.
Supportswildcards.
Case-insensitive.
appappActivityappPackageRequiredfortestingnativemobileapplicationsonAndroid.
Eitherthefullpathtotheapp,oracombinationofappActivityandappPackage.
Forexampleapp=MyApp.
apkorappActivity=.
LoginActivity;appPackage=silktest.
insurancemobileappbundleIdRequiredfortestingnativemobileapplicationsoniOS.
EitherthefullpathtotheapporthebundleId.
Forexampleapp=MyApp.
ipaorbundleId=silktest.
InsuranceMobileTestingMobileApplications|25ComponentDescriptionnoResetOptional:Canbesetwhentestingnativemobileapplications.
Isonlyvalidiftheappisspecified.
Trueiftheappshouldnotbereinstalledbeforetesting.
Falseiftheappshouldbereinstalledbeforetesting.
ThedefaultvalueisFalse.
isSimulatorOptional:UsedtospecifythatthetestshouldonlybeexecutedonaniOSSimulator.
Thedevicenamecanbeusedinstead.
isPhysicalDeviceOptional:Usedtospecifythatthetestshouldonlybeexecutedonaphysicaldevice.
Thedevicenamecanbeusedinstead.
Whenusingapoolofdevicesandtofindoutwhichdeviceisactuallyusedfortesting,youcanusethereturnvalueofthegenerateConnectionStringmethodofMobileDeviceclass.
TestingamobilewebapplicationonamobiledeviceoronanAndroidEmulatorWhentestingamobilewebapplicationonamobiledeviceoronanAndroidEmulator,theconnectionstringconsistsofthefollowingparts:1.
Themobiledevicename,forexampleMotoG3,orthedeviceID,forexample11111111.
Note:Ifthedevicenameisunique,MicroFocusrecommendstousethedevicenameintheconnectionstring,becausethedeviceIDislessreadable.
2.
Theplatformname.
3.
Thebrowserversion.
Thiscanonlybeusedincombinationwithsettingthebrowsertype4.
TheIPaddressorthehostnameofaspecificremotemachine,forexample10.
0.
0.
1.
YoucanalsousethenameofaremotelocationthatisspecifiedintheEditRemoteLocationsdialogboxasthehostname,forexampleMyRemoteLocation.
Whenusingtheremotelocationname,youcanalsousewildcards.
TotestanAndroiddevicethatisconnectedtothelocalmachine,specifytheIPaddressorthehostnameofthelocalmachine.
Example:ConnectionstringforanyavailableAndroiddevice"platformName=Android"Example:ConnectionstringforabrowseronanAndroiddevicethatisconnectedtothelocalmachineTotestamobilebrowseronanAndroiddevicethatisconnectedtothelocalmachine,theconnectionstringshouldlooksimilartothefollowing:"deviceName=MotoG3;platformName=Android;host=localhost"or"platformName=Android;deviceId=11111111;host=localhost"Example:ConnectionstringforabrowseronanAndroiddevicethatisconnectedtoaremotemachineTotestamobilebrowseronaremoteAndroiddevice,theconnectionstringshouldlooksimilartothefollowing:"deviceName=MotoG3;platformName=Android;host=10.
0.
0.
1""deviceName=MotoG3;platformName=Android;host=MyRemoteLocation*"26|TestingMobileApplicationsExample:ConnectionstringforabrowseronaniOSdevicethatisconnectedtoaMacTotestamobilebrowseronaremoteiOSdevice,theconnectionstringwouldlooklikethefollowing:"deviceName=myiPhone6;platformName=iOS;host=10.
0.
0.
1"TestinganativemobileapplicationonamobiledeviceoronanAndroidEmulatorWhentestinganativemobileapplicationonamobiledeviceoronanAndroidEmulator,theconnectionstringconsistsofthefollowingparts:1.
Themobiledevicename,forexampleMotoG3,orthedeviceID,forexample11111111.
Note:Ifthedevicenameisunique,MicroFocusrecommendstousethedevicenameintheconnectionstring,becausethedeviceIDislessreadable.
2.
Theplatformname.
3.
TheIPaddressorthehostnameofaspecificremotemachine,forexample10.
0.
0.
1.
YoucanalsousethenameofaremotelocationthatisspecifiedintheEditRemoteLocationsdialogboxasthehostname,forexampleMyRemoteLocation.
Whenusingtheremotelocationname,youcanalsousewildcards.
TotestanAndroiddevicethatisconnectedtothelocalmachine,specifytheIPaddressorthehostnameofthelocalmachine.
4.
Thenameofthefileoftheappthatyouwanttotest,ortheURLofthefile,ifthefileislocatedonawebserver.
ForexampleC:/MyApp.
apkorMyApp.
ipa.
Androidappsarealways.
apkfiles.
iOSappsonarealdevicearealways.
ipafiles.
iOSappsonaSimulatorareeitherazippedfileoradirectorywiththenameapp.
Example:ConnectionstringforanapponanAndroiddevicethatisconnectedtoaremotemachineTotesttheappMyApp.
apkonanAndroiddevicethatisconnectedtoaremotemachine,theconnectionstringwouldlooklikethefollowing:"platformName=Android;deviceName=MotoG3;host=http://10.
0.
0.
1;app=MyApp.
apk"Example:ConnectionstringforanapponaniOSdevicethatisconnectedtoaMacTotesttheappMyApp.
ipaonaniOSdevicethatisconnectedtoaremotemachine,theconnectionstringwouldlooklikethefollowing:"platformName=iOS;deviceName=MyiPhone;host=http://10.
0.
0.
1;app=MyApp.
ipa"TestingamobilewebapplicationonaniOSSimulatorWhentestingamobilewebapplicationonaniOSSimulator,theconnectionstringconsistsofthefollowingparts:1.
Theplatformname,whichisiOS.
2.
Theplatformversion,forexample10.
0.
3.
Themobiledevicename,forexampleiPhone6.
4.
TheIPaddressorthehostnameoftheMac,onwhichtheiOSSimulatorisrunning.
TestingMobileApplications|27Example:ConnectionstringforabrowseronaniOSSimulatoronaMac"platformName=iOS;platformVersion=10.
0;deviceName=iPhone6;host=10.
0.
0.
1;isSimulator=true"TestinganativemobileapplicationonaniOSSimulatorWhentestinganativemobileapplicationonaniOSSimulatoronaMac,theconnectionstringconsistsofthefollowingparts:1.
Theplatformname,whichisiOS.
2.
Theplatformversion,forexample10.
0.
3.
Themobiledevicename,forexampleiPhone6.
4.
TheIPaddressorthehostnameoftheremotemachine,forexample10.
0.
0.
1.
5.
Thenameoftheappthatyouwanttotest,forexampleMyApp.
ipa.
Example:ConnectionstringforanapponaniOSSimulatoronaMac"platformName=iOS;platformVersion=10.
0;deviceName=iPhone6;host=10.
0.
0.
1;app=MyApp.
ipa;isSimulator=true"TroubleshootingwhenTestingMobileApplicationsWhydoestheSelectApplicationdialognotdisplaymymobiledevicesIfSilkTestdoesnotrecognizeamobiledeviceoremulator,theMobiletabintheSelectApplicationdialogdoesnotdisplaythedeviceoremulator.
Additionally,theWebtaboftheSelectApplicationdialogdoesnotdisplaythemobilebrowsersthatareinstalledonthedeviceoremulator.
SilkTestmightnotrecognizeamobiledeviceoremulatorforoneofthefollowingreasons:ReasonSolutionTheemulatorisnotrunning.
Starttheemulator.
TheAndroidDebugBridge(adb)doesnotrecognizethemobiledevice.
Tocheckifthemobiledeviceisrecognizedbyadb:1.
NavigatetotheAndroidDebugBridge(adb)intheAndroidSDKinstallationfolder.
IftheAndroidSDKisnotinstalled,navigatetoC:\ProgramFiles(x86)\Silk\SilkTest\ng\Mobile\windows\AndroidTools\platform-toolstousetheadbthatisinstalledwithSilkTest.
2.
HoldShiftandright-clickintotheFileExplorerwindow.
3.
SelectOpencommandwindowhere.
4.
Inthecommandwindow,typeadbdevicestogetalistofallattacheddevices.
5.
Ifyourdeviceisnotlisted,checkifUSB-debuggingisenabledonthedeviceandiftheappropriateUSBdriverisinstalled.
6.
Ifyougetanerror,forexampleadbserverisoutofdate,ensurethattheadbversioninC:\ProgramFiles(x86)\Silk\SilkTest28|TestingMobileApplicationsReasonSolution\ng\Mobile\windows\AndroidTools\platform-toolsisthesameastheadbversionofyourlocalAndroidSDK.
Foradditionalinformation,seeWhatcanIdoiftheconnectionbetweentheOpenAgentandmydeviceisunstable.
TheversionoftheoperatingsystemofthedeviceisnotsupportedbySilkTest.
Forinformationonthesupportedmobileoperatingsystemversions,refertotheReleaseNotes.
TheUSBdriverforthedeviceisnotinstalledonthelocalmachine.
InstalltheUSBdriverforthedeviceonthelocalmachine.
Foradditionalinformation,seeInstallingaUSBDriver.
USB-debuggingisnotenabledonthedevice.
EnableUSB-debuggingonthedevice.
Foradditionalinformation,seeEnablingUSB-Debugging.
Note:Ifallprevioussolutionsdonotwork,youcouldtrytorestartthedevice.
WhydoesSilkTestsearchforaURLinChromeforAndroidinsteadofnavigatingtotheURLChromeforAndroidmightinsomecasesinterprettypinganURLintotheaddressbarasasearch.
AsaworkaroundyoucanmanuallyaddacommandtoyourscripttonavigatetotheURL.
WhatdoIdoiftheadbserverdoesnotstartcorrectlyWhentheAndroidDebugBridge(adb)serverstarts,itbindstolocalTCPport5037andlistensforcommandssentfromadbclients.
Alladbclientsuseport5037tocommunicatewiththeadbserver.
Theadbserverlocatesemulatoranddeviceinstancesbyscanningodd-numberedportsintherange5555to5585,whichistherangeusedbyemulatorsanddevices.
Adbdoesnotallowchangingthoseports.
Ifyouencounteraproblemwhilestartingadb,checkifoneoftheportsinthisrangeisalreadyinusebyanotherprogram.
Foradditionalinformation,seehttp://developer.
android.
com/tools/help/adb.
html.
WhatcanIdoiftheconnectionbetweentheOpenAgentandmydeviceisunstableIfyouhaveinstalledtheAndroidSDKoranothertoolthatusestheAndroidDebugBridge(adb),anadditionaladbservermightberunninginadditiontotheonethatisusedbySilkTest.
Iftherunningadbservershavedifferentversions,theconnectionbetweentheOpenAgentandthedevicemightbecomeunstableorevenbreak.
Toavoidversionmismatcherrors,specifythepathtotheAndroidSDKdirectorybysettingtheenvironmentvariableSILKTEST_ANDROID_HOME,forexampletoC:\Users\\AppData\Local\Android\android-sdk.
Ifthevariableisnotset,theadbversionthatisshippedwithSilkTestisused.
WhydoIgettheerror:Failedtoallocatememory:8Thiserrordisplaysifyouaretryingtostartuptheemulatorandthesystemcannotallocateenoughmemory.
Youcantrythefollowing:1.
LowertheRAMsizeinthememoryoptionsoftheemulator.
2.
LowertheRAMsizeofIntelHAXM.
TolowertheRAMsize,runtheIntelHaxm.
exeagainandchoosechange.
3.
OpentheTaskManagerandcheckifthereisenoughfreememoryavailable.
Ifnot,trytofreeupadditionalmemorybyclosingafewprograms.
TestingMobileApplications|29WhydoIgettheerror"SilkTestcannotstarttheappthatyouhavespecified"duringtestingonaniOSdeviceThiserrormightdisplayforoneormoreofthefollowingreasons:ReasonSolutionTheiOSdeviceisnotindevelopermode.
Youcanenablethedevelopermodeinoneofthefollowingtwoways:ConnectthedevicetoaMaconwhichXcodeisinstalled,andstarttheappthatyouwanttotestonthedevice.
Addyourprovisioningprofilestothedevice.
1.
OpenXcode.
2.
SelectWindow>Devices.
3.
Right-clickontheiOSdevice.
4.
SelectShowProvisioningProfiles.
5.
Addyourprovisioningprofiles.
YouhaverecentlyupdatedtheiOSversionofthedevice.
1.
OpenXcode.
2.
SelectWindow>Devices.
3.
WaitunitlXcodehasprocessedthesymbolfiles.
UIautomationisnotenabledontheiOSdevice.
1.
SelectSettings>Developer.
2.
ActivateEnableUIAutomation.
TheWebInspectorisnotactivatedontheiOSdevice,whileyouaretryingtotestamobilewebapplication.
1.
ClickSettings>Safari>Advanced.
2.
ActivatetheWebInspector.
TheappthatyouwanttotestwasnotbuiltfortheiOSversionoftheiOSdeviceonwhichyouaretesting.
UseXcodetobuildtheappfortheiOSversionofthedevice.
TheSoftwareUpdatedialogboxiscurrentlyopenontheiOSdevice.
Closethedialogboxanddisableautomaticsoftwareupdates:1.
SelectSettings>AppandiTunesStores>AUTOMATICDOWNLOADS.
2.
DeactivateUpdates.
WhydoesmyAndroiddevicedisplayonlytheBackbuttoninthedynamichardwarecontrolsIftheAndroidortheAndroidEmulatorisscreen-lockedwhenyoustarttesting,thedeviceorEmulatormightdisplayonlythebuttonBackinthedynamichardwarecontrols.
Tosolvethisissue,stoptheOpenAgent,restartthedevice,andchangethedevicesettingstonolongerlockthescreen.
WhydoesmyAndroiddeviceoremulatornolongerdisplayakeyboardTosupportunicodecharacters,SilkTestreplacesthestandardkeyboardwithacustomkeyboard.
Whentestingisfinished,theoriginalkeyboardisrestored.
Ifanerroroccursduringtesting,thecustomkeyboardmightstillbeactiveandcannotbereplaced.
Tosolvethisissue,manuallyresetthekeyboardunderSettings>Language&input>CurrentKeyboard.
30|TestingMobileApplicationsWhydoesmydevicenotrespondduringtestingIfthedevice,emulator,orSimulatorisscreen-lockedwhenyoustarttesting,andSilkTestisunabletounlockthescreen,thedevice,emulator,orSimulatormightstoprespondingtoanyactions.
Tosolvethisissue,stoptheOpenAgentandchangethedevicesettingstonolongerlockthescreen.
WhycanInotinstalltheInformationServiceonaMacWhentheAllowappsdownloadedfromsettingintheGeneraltaboftheSecurity&PrivacysystempreferencespaneissettoMacAppStoreandidentifieddevelopers,whichisthedefaultvalue,thefollowingerrormessageappearswhenopeningtheInformationServicesetup:"SilkTestInformationService.
pkg"can'tbeopenedbecauseitisfromanunidentifieddeveloper.
Tosolvethisissue,useoneofthefollowing:Right-clickthesetupfileandselectOpen.
Awarningmessagewillappear,butyouwillstillbeabletoopenthefile.
SettheAllowappsdownloadedfromsettingtoAnywhere.
Afterattemptingtoopenthefile,navigatetotheGeneraltaboftheSecurity&PrivacysystempreferencespaneandclickOpenAnyway.
WhyistheRecordingwindowblackwhenrecordinganAndroidappAndroidappsthatrequireahigherlevelofsecurity,forexampleappsthathandlefinancialtransactions,mighthavetheFLAG_SECUREflagset,whichpreventsSilkTestfromcapturingtheapp.
SilkTestreliesonscreenshotsoronavideooftheAndroiddeviceduringrecordingandwilldisplayablackscreenofthedeviceintheRecordingwindow,iftheAndroidappthatyouaretestinghasthisflagset.
TotestsuchanappwithSilkTest,youhavetocontacttheappdevelopmentteam,andaskthemtoun-settheFLAG_SECUREflagduringtesting.
WhydoesSilkTestnotshowavideowhentestingonanAndroidemulatorIftheemulatorisusingthegraphiccardofyourcomputerforbetterrendering,thevideocapturingofSilkTestmightnotwork.
Tosolvethis,emulatethegraphicsinsoftware:1.
OpentheAndroidVirtualDeviceManager.
2.
ClickEditintheActionscolumnoftheemulator.
3.
SelectSoftwarefromthelistintheEmulatedPerformanceareaoftheVirtualDeviceConfigurationdialog.
WhatcanIdoifSilkTestdoesnotshowavideowhentestinginacloudenvironmentWhentestinginacloudenvironment,showingavideomightnotworkwhenrecordingorreplayingatest,forexamplebecauserequiredportsarenotopen.
Tosolvethisissue,youcanspecifyalistofWebDriverhostURLsintheinfoservice.
propertiesfile.
Forinformationonhowtoaccessthispropertiesfile,seeEditingthePropertiesoftheSilkTestInformationService.
Addtheoptioninfoservice.
disableScreencastHoststothefile,bytypingthefollowing:infoservice.
disableScreencastHosts=,,.
.
.
Forexample:infoservice.
disableScreencastHosts=http://my-webdriver-server-url.
com:80/wd/hubYoucanspecifyURLpatternslike*my-webdriver-server-url.
combyusingasterisks(*)aswildcards.
SilkTestwillshowaseriesofscreenshotsinsteadofavideowhenrecordingandreplayingonthespecifiedhosts.
TestingMobileApplications|31HowcanIchangetheinstalledversionofXcodeIftheversionofXcodethatyouareusingisnotsupportedbySilkTest,forexamplewhenyouupgradetothelatestversionofXcode,anerrormessagemightappearwhentestingoniOS.
ToreplacetheinstalledversionofXcodewithasupportedversion,downloadasupportedXcodeversionfromhttps://developer.
apple.
com/download/more/,andreplacetheunsupportedversionwiththedownloadedversion.
ForinformationaboutthesupportedXcodeversions,refertotheReleaseNotes.
WhatcanIdoifmyMacrunsoutofdiskspaceSilkTestusesInstrumentstoautomateiOSdevices.
Thistoolcreateslargelogfilesinthe/Library/Caches/com.
apple.
dt.
instrumentsdirectory,whichmightfillupdiskspaceontheMac.
Tosolvethisissue,MicroFocusrecommendsregularlydeletingtheselogfiles,eithermanuallyorbyusingacronjob.
Forexample,todeletethefileseachdayatthesametime,youcoulddothefollowing:1.
Typesudocrontab-eintoaTerminal.
Thisopensaneditorinwhichyoucaneditthecrontabforroot.
2.
Addthefollowinglinetothecrontab:021**find/Library/Caches/com.
apple.
dt.
instruments-mtime+10-delete3.
Savethecrontab.
Inthisexample,alllogfilesthatareolderthantendayswillbedeletedeachdayat2AMfromthedirectory.
Whydoesmytestfailwiththeerrormessage"Xcodebuildfailedwithcode65"WhentestingonaphysicaliOSdevice,thiserrorusuallymeansthatduringthebuildprocesstheWebDriverAgentappcouldnotbesignedorthatthereisaproblemwiththeprovisioningprofile.
Youcanchecktheactualproblemwiththefollowingcommands,whichhavetobeexecutedattheMacmachinetowhichthedeviceisconnected:cd/Applications/Silk/Mobile/common/Appium/node_modules/appium-xcuitest-driverxcodebuild-projectWebDriverAgent.
xcodeproj-schemeWebDriverAgentRunner-destination'id='testVerifythatthefolderResourcesexistsunder/Applications/Silk/Mobile/common/Appium/node_modules/appium-xcuitest-driverandthatthefoldercontainsthefileWebDriverAgent.
bundle.
Ifnot,createthisfolderandanemptyWebDriverAgent.
bundlefile,forexamplebyusingthefollowingcommand:mkdir-pResources/WebDriverAgent.
bundleWhatcanIdotopreventtheDeveloperToolsAccessfromrequestingtotakecontrolofanotherprocessWhenstartingtheexecutionofatestoniOS,amessageboxstatingthefollowingmightappear:DeveloperToolsAccessneedstotakecontrolofanotherprocessfordebuggingtocontinue.
Typeyourpasswordtoallowthis.
Toavoidgettingthismessage,executethefollowingcommandinaTerminal:sudo/usr/sbin/DevToolsSecurity--enableWhyaretherectangleswrongwhiletestingamobilewebapplicationonaniPadIftherectanglesaroundcontrolsareoffsetwhentestingamobilewebapplicationonaniPad,youmighthavemultiplebrowsertabsopenandtheTabbarmightbedisplayed.
Tofixthisissue,closealltabsexceptone.
HowCanIUseChromeforAndroidtoReplayTestsBydefaultyoucanusetheSelectBrowserdialogboxtoselectthebrowserduringreplay.
32|TestingMobileApplicationsIfyouexecuteascriptfromthecommandlineorfromaContinuousIntegration(CI)server,youcanspecifytheconnectionstringintheapplicationconfigurationofthescript.
Tooverwritethebrowserthatisspecifiedintheapplicationconfiguration,usethesilktest.
configurationNameenvironmentvariable.
YoucanalsousethepropertybrowsertypeoftheBrowserApplicationclasstosetthetypeofthebrowserthatisusedduringreplay.
However,thebrowsertypedoesnotincludeanexplicitvalueforChromeforAndroid.
TospecifythatyouwanttouseChromeforAndroidasthebrowser,onwhichatestisreplayed,setthebrowsertypetoGoogleChromeandspecifyAndroidastheplatform.
WhenAndroidisspecified,SilkTestusesChromeforAndroidinsteadofGoogleChromeonadesktopmachinetoexecutethetest.
ExamplesThefollowingcodesampleshowshowyoucansetthebasestateforatesttouseChromeforAndroidonaNexus7byusingthesilktest.
configurationName:SETsilktest.
configurationName="platformName=Android;deviceName=Nexus7;host=10.
0.
0.
1-Chrome"ThefollowingJavacodesampleshowshowyoucansetthebasestateforatesttouseChromeforAndroidbyusingthebrowsertype:BrowserBaseStatebaseState=newBrowserBaseState(BrowserType.
GoogleChrome,"demo.
borland.
com/InsuranceWebExtJS/");baseState.
setConnectionString("platformName=Android");baseState.
execute(desktop);LimitationsforTestingMobileWebApplicationsThesupportforplayingbacktestsandrecordinglocatorsonmobilebrowsersisnotascompleteasthesupportfortheothersupportedbrowsers.
Theknownlimitationsforplayingbacktestsandrecordinglocatorsformobilewebapplicationsare:Thefollowingclasses,interfaces,methods,andpropertiesarecurrentlynotsupportedformobilewebapplications:BrowserApplicationclass.
CloseOtherTabsmethodCloseTabmethodExistsTabmethodGetActiveTabmethodGetSelectedTabmethodGetSelectedTabIndexmethodGetSelectedTabNamemethodGetTabCountmethodImageClickmethodOpenTabmethodSelectTabmethodDomElementclass.
DomDoubleClickmethodDomMouseMovemethodGetDomAttributeListmethodTestingMobileApplications|33IKeyableinterface.
PressKeysmethodReleaseKeysmethodSilkTestdoesnotsupporttestingHTMLframesandiFrameswithAppleSafarioniOS.
Recordinginlandscapemodeisnotsupportedforemulatorsthatincludevirtualbuttonsinthesystembar.
Suchemulatorsdonotcorrectlydetectrotationandrenderthesystembarinlandscapemodetotherightofthescreen,insteadofthelowerpartofthescreen.
However,youcanrecordagainstsuchanemulatorinportraitmode.
OnlyHTMLattributesintheHTMLDOMaresupportedinXPathexpressionsformobileapplications.
SilkTestdoesnotsupportpropertiesinXPathexpressions.
IfyouaretestingamobilewebapplicationonAndroid,SilkTestdoesnotsupportzooming.
ThefollowingJavaScriptalert-handlingmethodsoftheBrowserWindowclassdonotworkwhentestingontheOriginalAndroidStock(AOSP)Browser:AcceptAlertmethodDismissAlertmethodGetAlertTextmethodIsAlertPresentmethodAtanygivenpointintime,youcantestonmultiplephysicaliOSdevicesthatareconnectedtotheMac,butonlyononeiOSSimulatorthatisrunningontheMac.
Beforestartingtotestamobilewebapplication,ensurethatnobrowsertabisopen.
Tip:OniPadsyoucandisabletabsinAppleSafari.
NavigatetoSettings>SafarianddisableShowTabBartodoso.
Whiletestingamobilewebapplication,youcanonlyhaveonebrowsertabopen.
SilkTestdoesnotsupporttestingmobilewebapplicationsthatareopenedbyanativemobileapplication.
LimitationsforTestingNativeMobileApplicationsTheknownlimitationsforplayingbacktestsandrecordinglocatorsonnativemobileapplications(apps)are:Thefollowingclasses,interfaces,methods,andpropertiesarecurrentlynotsupportedfornativemobileapplications:IKeyableinterface.
PressKeysmethodReleaseKeysmethodMobileDeviceclass.
WhentestinganativemobileapplicationoniOS,theSetLocationmethodisnotsupported.
WhentestinganativemobileapplicationonanAndroidversionpriortoAndroid6.
0,youhavetoenableAllowmocklocationstousetheSetLocationmethod.
Todoso,openthesettingsoftheAndroiddeviceoremulatorandtapDeveloperOptions.
WhentestinganativemobileapplicationonAndroid6.
0orlater,youhavetosettheapptoAppiumSettingstousetheSetLocationmethod.
Todoso,openthesettingsoftheAndroiddeviceoremulatorandtapDeveloperOptions>Selectmocklocationapp.
ThenchooseAppiumSettings.
Note:TheAppiumSettingsentryisonlyavailableifyouhavealreadyexecutedatestwithAppiumontheAndroiddeviceoremulator.
WhentestingoniOS,theFindmethoddoesnotworkinthefollowingcases:34|TestingMobileApplicationsIfthepathattributeisset.
Ifanattributevalueisempty.
WhentestingoniOS,thegetValuemethodoftheXCUIElementTypeSwitchclassreturnsthestringsfalseortruedependingonthecheckedstate,insteadofreturningthestrings0and1.
RecordinginlandscapemodeisnotsupportedforAndroidemulatorsthatincludevirtualbuttonsinthesystembar.
Suchemulatorsdonotcorrectlydetectrotationandrenderthesystembarinlandscapemodetotherightofthescreen,insteadofthelowerpartofthescreen.
However,youcanrecordagainstsuchanemulatorinportraitmode.
OnlyHTMLattributesintheHTMLDOMaresupportedinXPathexpressionsformobileapplications.
SilkTestdoesnotsupportpropertiesinXPathexpressions.
Atanygivenpointintime,youcantestonmultiplephysicaliOSdevicesthatareconnectedtotheMac,butonlyononeiOSSimulatorthatisrunningontheMac.
WithSilkTest17.
5Hotfix1orlater,youarenolongerrequiredtousemultipleusersessionsonaMactotestmobileapplicationsoniOS.
SilkTestdoesnotsupporttextrecognitionwhentestingnativemobileapplicationsonbothAndroidandiOS.
Textrecognitionincludesthefollowingmethods:TextCaptureTextClickTextExistsTextRectangleSilkTestdoesnotsupporttestingnativemobileapplicationswithmultiplewebviews.
WhentestingoniOS,thestateoftheisVisiblepropertyisalwaystrue,eveniftheelementisnotvisible.
WhentestingoniOS,aswipeactionwithmultiplestepsswipestoapoint,releasesthemousepointerandthenswipestothenextpoint.
OnpriorversionsofiOS,theactiondoesnotreleasethemousepointerbetweentheswipes.
WhentestingoniOS,SilkTestdoesnotsupportanymulti-touchactionsexceptpinch.
WhentestingoniOS,SilkTestdoesnotsupportthePinchInmethod.
WhentestingoniOS,youcanonlyacceptordismissalertdialogboxes.
IfnoCancelbuttonisavailableandSilkTestcannotdismissthedialog,thedefaultactionistoacceptthedialog.
WhentestingonAndroid,SilkTestdoesnotprovideautomatedsynchronizationforcontrolsoftheAnimationclass.
WhentestingoniOS,SilkTestdoesnotprovideautomatedsynchronizationforcontrolsthatcalltheUIView.
animatefunctionortheUIView.
animateWithDurationfunction.
Youcanworkaroundthisissuebyincreasingthespeedoftheanimationintheappdelegate:funcapplication(application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:[NSObject:AnyObject])->Bool{//.
.
.
ifNSProcessInfo.
processInfo().
environment["automationName"]=="SilkTest"{//Speedanimationsup(recommended)window!
.
layer.
speed=100;}}MicroFocusdoesnotrecommenddisablingsuchanimationscompletely,asthismightchangetheapplicationsbehavior.
However,ifspeedinguptheanimationdoesnotresolvethesynchronizationissue,youcouldcompletelydisableanimationsintheappdelegateasfollows:funcapplication(application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:[NSObject:AnyObject])->Bool{//.
.
.
ifNSProcessInfo.
processInfo().
environment["automationName"]=="SilkTest"{UIView.
setAnimationsEnabled(false)TestingMobileApplications|35}}ClickingonObjectsinaMobileWebsiteWhenclickingonanobjectduringtherecordingandreplayofanautomatedtest,amobilewebsitepresentsthefollowingchallengesincomparisontoadesktopwebsite:Varyingzoomfactorsanddevicepixelratios.
Varyingscreensizesfordifferentmobiledevices.
Varyingfontandgraphicsizesbetweenmobiledevices,usuallysmallerincomparisontoawebsiteinadesktopbrowser.
Varyingpixelsizeandresolutionfordifferentmobiledevices.
SilkTestenablesyoutosurpassthesechallengesandtoclicktheappropriateobjectonamobilewebsite.
Whenrecordingatestonamobiledevice,SilkTestdoesnotrecordcoordinateswhenrecordingaClick.
However,forcross-browsertesting,coordinatesareallowedduringreplay.
YoucanalsomanuallyaddcoordinatestoaClick.
SilkTestinterpretsthesecoordinatesastheHTMLcoordinatesoftheobject.
ToclickontheappropriateobjectinsidetheBrowserWindow,duringthereplayofatestonamobiledevice,SilkTestappliesthecurrentzoomfactortotheHTMLcoordinatesoftheobject.
ThedevicepixelcoordinatesaretheHTMLcoordinatesoftheobject,multipliedwiththecurrentzoomfactor.
Iftheobjectisnotvisibleinthecurrentlydisplayedsectionofthemobilewebsite,SilkTestscrollstotheappropriatelocationinthewebsite.
ExampleThefollowingcodeshowshowyoucantestaDomButtonwithafixedsizeof100x20pxinyourHTMLpage.
Duringreplayonadifferentmobiledeviceorwithadifferentzoomfactor,theDomButtonmightforexamplehaveanactualwidthof10pxonthedevicescreen.
SilkTestclicksinthemiddleoftheelementwhenusingthecodeabove,independentofthecurrentzoomfactor,becauseSilkTestinterpretsthecoordinatesasHTMLcoordinatesandappliesthecurrentzoomfactor.
UsingExistingMobileWebTestsSilkTest17.
0orlaterusesadifferentapproachtomobilewebtestingthanpreviousversionsofSilkTest.
ThischangemightresultinyouroldmobilewebtestsnolongerworkingonSilkTest17.
0orlater.
ThistopicdescribessomeofthechangesthatwereintroducedwithSilkTest17.
0andprovidesguidanceonchangingexistingmobilewebtestswithSilkTest17.
0orlater.
ThefollowingchangesformobilewebtestingwereintroducedwithSilkTest17.
0:WithpreviousversionsofSilkTest,youwereabletotestoniOSdevicesthatwereconnectedbyUSBtoaWindowsmachine.
WithSilkTest17.
0orlater,youcanonlytestoniOSdevicesthatareconnectedtoanOSXmachine(Mac).
IfyouhavetestedmobilewebapplicationsonanAndroiddevicewithapreviousversionofSilkTest,youhavetomanuallyremovetheproxyfromtheAndroiddevicetotestawebapplicationwithSilkTest17.
0orlater.
SilkTest17.
0orlaternolongerrequiresaproxy,andiftheproxyisset,themessageUnabletoconnecttotheproxyserverdisplaysonthedevice.
36|TestingMobileApplicationsIndexAAndroidconfiguringemulator7enablingUSB-debugging7hybridapplications5installedapps,testing21installingUSBdrivers6mobilenativeapplications,prerequisites4mobilewebapplications,prerequisites4paralleltesting,testedconfigurations8recommendedsettings7releasingdevices23releasingdevices,recording23releasingdevices,replay24testing4troubleshooting28Androidemulatorconfiguring7AppleSafariinformationservice,installing16,20BbrowsertypeChromeforAndroid,setting32browsertypeChromeforAndroid,setting32CcapabilitiesiOS20ChromeforAndroidbrowsertype,setting32Clickmobileweb36ConfigurationAssistantautomaticsigning17connectionstringmobiledevices25cross-browsertestingremotelocations,adding24Ddevicenotconnectedmobile28Eeditingremotelocations24Emulatordefining,playback22emulatorstesting4HhybridapplicationsAndroid5iOS15Iinformationserviceediting20Mac,installing16,20installedappsAndroid,testing21iOS,testing21installinginformationservice,Mac16,20installingUSBdriversAndroid6iOSapps,preparingfortesting16devices,preparing16hybridapplications15informationservice,installing16,20installedapps,testing21Mac,preparing17mobilenativeapplications,prerequisites11mobilewebapplications,prerequisites11nativeapp,Simulator13nativeapp,testing12recommendedsettings21releasingdevices23releasingdevices,recording23releasingdevices,replay24testing10testing,nodeveloperaccount19webapp,Simulator14webapp,testing14iOS10existingscripts,executing21Llimitationsmobilewebapplications33nativemobileapplications34MMacinformationservice,installing16,20mobiletroubleshooting28mobileapplicationsrecording22testing4mobilebrowserslimitations33mobiledevicedefining,playback22mobiledevicesinteractingwith23performingactionsagainst23mobilenativeapplicationslimitations34Index|37mobilerecordingabout22mobiletestingAndroid4connectionstring25iOS10nativeapp,iOSSimulator13overview4releasingdevices23remotelocations,adding24webapp,iOS14webapp,iOSSimulator14mobiletestingdevicesnativeapp,iOS12mobilewebClick36iOS14legacytests36mobilewebapplicationsAndroid,prerequisites4iOS,prerequisites11limitations33NnativemobileapplicationsAndroid,prerequisites4iOS,prerequisites11limitations34Pparalleltestingtestedconfigurations,Android8playbackselectingdevice22prerequisitesAndroid,mobilewebapplications4Android,nativemobileapplications4iOS,mobilewebapplications11iOS,nativemobileapplications11Rrecordingmobileapplications22noimagedisplayed28releasingdevices23releasingdevicesmobiletesting23recording23replay24remotelocationsadding24editing24replayreleasingdevices24selectingdevice22runningexistingscriptsiOS1021Sscreencastnotworking28settingmobiledeviceplayback22Simulatordefining,playback22mobilewebapplications,testing14nativeapp,testing13testing12TtestingAppleSafariinformationservice,installing16,20troubleshootingmobile28UuploadappMac4Vvideonotdisplayed28XxBrowserChromeforAndroid,setting3238|Index

ParkinHost:俄罗斯离岸主机,抗投诉VPS,200Mbps带宽/莫斯科CN2线路/不限流量/无视DMCA/55折促销26.4欧元 /年起

外贸主机哪家好?抗投诉VPS哪家好?无视DMCA。ParkinHost今年还没有搞过促销,这次parkinhost俄罗斯机房上新服务器,母机采用2个E5-2680v3处理器、128G内存、RAID10硬盘、2Gbps上行线路。具体到VPS全部200Mbps带宽,除了最便宜的套餐限制流量之外,其他的全部是无限流量VPS。ParkinHost,成立于 2013 年,印度主机商,隶属于 DiggDigi...

免费注册宝塔面板账户赠送价值3188礼包适合购买抵扣折扣

对于一般的用户来说,我们使用宝塔面板免费版本功能还是足够的,如果我们有需要付费插件和专业版的功能,且需要的插件比较多,实际上且长期使用的话,还是购买付费专业版或者企业版本划算一些。昨天也有在文章中分享年中促销活动。如今我们是否会发现,我们在安装宝塔面板后是必须强制我们登录账户的,否则一直有弹出登录界面,我们还是注册一个账户比较好。反正免费注册宝塔账户还有代金券赠送。 新注册宝塔账户送代金券我们注册...

CYUN专注海外精品服务器资源 国庆钜惠 最低5折起 限量促销

国庆钜惠 最低5折起 限量促销CYUN专注海外精品服务器资源,主营香港CN2 GIA、美国CERA、美国高防服务器资源,实体公司,ISP/IDC资质齐全,客服配备齐全。本次针对国庆推出非常给力的促销活动,旗下所有平台同享,新老客户同享,限时限量,售完截止。活动截止时间:2021年10月9日官网地址:www.cyun.net参与机型:香港CN2 GIA云服务器、香港双程CN2云服...

crontab为你推荐
美国主机租用美国服务器多少钱一年?中文域名注册查询域名还分中文和英文的吗,在哪里可以查到中文域名到期了?美国vps租用如何选择国外vps服务器?国外主机空间2个国外主机空间,都放了BLOG,看看哪个更快?云服务器租用云服务器怎么租呀香港虚拟空间最稳定香港虚拟主机空间在哪里?网站空间购买购买网站空间需要注意什么重庆网站空间重庆建网站的公司 我司准备建一个好点的网站,求推荐虚拟主机控制面板虚拟主机控制面板是什么?山东虚拟主机山东东营制作网站的公司在哪里?
国外主机空间 上海vps 企业域名备案 krypt 新秒杀 Vultr 监控宝 日志分析软件 正版win8.1升级win10 info域名 parseerror 蜗牛魔方 umax120 免费网页申请 新睿云 帽子云排名 免费asp空间申请 万网注册 免费网络空间 大化网 更多