PopupWatcher not running when executed from Command line
Posted: Thu Mar 06, 2014 8:22 pm
I have a watcher usercode module which watches for a warning from the browser regarding self signed certificates. If a cert warning appears, the watcher will click through the various buttons to accept the self-signed cert and move on. I've placed this code module in [SETUP] section of the test suite.The suite contains two test cases Everything works fine when running from Ranorex Studio. However, I need it to run in our CI system which has a runtime license.
This appears to be a bug, but I'm not sure. Maybe I need to run something else in the command line to trigger SETUP. Screenshots and code below
command line is executed from a CMD script. Note that there's a conditional which triggers the second test case. I have explicit mention of SETUP:
This appears to be a bug, but I'm not sure. Maybe I need to run something else in the command line to trigger SETUP. Screenshots and code below
command line is executed from a CMD script. Note that there's a conditional which triggers the second test case. I have explicit mention of SETUP:
Code: Select all
@echo on
set tb=%1
set vm=%2
set configwiz=%3
set extip=%4
C:\source\ranorex\HTA-deployer\HTA-deployer\HTA-Console\bin\Debug\HTA-deployer.exe /ts:HTA-Console /tc:Console_Data /pa:DatacenterName=MKPHYS /pa:ClusterName="Cisco UCS" /pa:ResourcePoolName=Auto-Testing /pa:ResoucePoolTestBedName=%tb% /pa:hta_vmname=%vm%
IF %configwiz% == true (
echo "----config wizard---"
C:\source\ranorex\HTA-deployer\HTA-deployer\HTA-Console\bin\Debug\HTA-deployer.exe /ts:HTA-Console /tc:Config_Wizard /pa:htcc-ip=%extip%
)
Code: Select all
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;
// Create PopupWatcher
PopupWatcher sslPopupWatcher = new PopupWatcher();
sslPopupWatcher.Watch(sslRepo.UntrustedConnection.FFIUnderstandTheRisksInfo, AcceptCertFF);
sslPopupWatcher.Watch(sslRepo.UntrustedConnection.IEOverridelinkInfo, AcceptCertIE);
sslPopupWatcher.UpdateInterval = 8000;
// Start PopupWatcher
sslPopupWatcher.Start();
}
public static void AcceptCertFF(Ranorex.Core.Repository.RepoItemInfo myInfo, Ranorex.Core.Element myElement)
{
Report.Log(ReportLevel.Info, "This appears to be Firefox");
sslRepo.UntrustedConnection.FFIUnderstandTheRisks.Click();
//Inserting delays for ease of debugging. You need a few seconds in case something goes wrong and you need to stop run
Delay.Duration(3000, false);
sslRepo.UntrustedConnection.FFExceptionDialogButton.Click();
Delay.Duration(3000, false);
Keyboard.Press("{Tab}{Tab}{Tab}{Tab}");
Keyboard.Press("{Return}");
}
public static void AcceptCertIE(Ranorex.Core.Repository.RepoItemInfo myInfo, Ranorex.Core.Element myElement)
{
Report.Log(ReportLevel.Info, "This appears to be IE");
sslRepo.UntrustedConnection.IEOverridelink.Click();
}