Page 1 of 1

Microsoft Edge browser intial element recongition

Posted: Fri Nov 20, 2015 7:34 pm
by mtaylor
So the issue is Microsoft Edge because it first starts out as a winAPP you cannot use web.document to latch on to the HTML elements. So when I am trying to bypass the ssl security warning using the guide here http://www.ranorex.com/forum/using-popu ... t5409.html I am unable to see the html elements even though they are embedded behind the winapp. The spy tool cannot see them and writing in a manual xpath does not work. Please help!

[img]RanorexIssue.JPG[/img]

Re: Microsoft Edge browser intial element recongition

Posted: Tue Nov 24, 2015 11:11 am
by Support Team
Hello mtaylor,

You could watch for the following tab to exist:
EdgeCertIssue.png
Afterwards, simply navigate to the “Continue to this webpage…” as you did in Chrome.

Hope this information helps.

Sincerely,
Robert

Re: Microsoft Edge browser intial element recongition

Posted: Fri Dec 04, 2015 11:39 pm
by mtaylor
SO here is the issue. I see what you are saying to do and I am sort of doing that however...

I'm noticing that two instances of the Popupwatcher are being called when I get to Chrome/Edge. Then because its trying to execute my method twice there are tabs and enters flying everywhere.

[img]Capture.jpg[/img]

Re: Microsoft Edge browser intial element recongition

Posted: Sat Dec 05, 2015 12:51 am
by mtaylor
I figured it out and for those that need the code for all the browsers here you go:

Code: Select all

 public partial class OpenBrowser
    {
    	
    	public static TestGroovApp.GroovAppRepository SSLRepo = TestGroovApp.GroovAppRepository.Instance;
    	    	   	
        /// <summary>
        /// This method gets called right after the recording has been started.
        /// It can be used to execute recording specific initialization code.
        /// </summary>
        ///      
        private void Init()
        {
   	    	PopupWatcher securityPopupWatcher = new PopupWatcher();
   	    	
   	    	if(BrowserName.Equals("Chrome")){   	    		
   	       	securityPopupWatcher.Watch(SSLRepo.GoogleChrome.PrivacySecurityWarnings.AddressAndSearchBarInfo, ConfirmSecurityWarningCE);   	       	
   	    	}
   	    	
   	    	if(BrowserName.Equals("IE")){   	    		
   	       	securityPopupWatcher.Watch(SSLRepo.InternetExplorer.PrivacySecurityWarnings.OverridelinkInfo, ConfirmSecurityWarningIE);   	       	
   	    	}
   	    	
   	    	if(BrowserName.Equals("Firefox")){
   	    	securityPopupWatcher.Watch(SSLRepo.Firefox.PrivacySecurityWarnings.FirefoxInitialWarning.IUnderstandTheRisksInfo, ConfirmSecurityWarningFFAdd);
   	    	securityPopupWatcher.Watch(SSLRepo.Firefox.PrivacySecurityWarnings.FirefoxPopupSecurityForm, ConfirmSecurityWarningFFConfirm);
   	    	}
   	    	
   	    	if(BrowserName.Equals("Edge")){
   	    	securityPopupWatcher.Watch(SSLRepo.MicrosoftEdge.PrivacySecurityWarnings.CertificateErrorTabCaptionInfo, ConfirmSecurityWarningMEConfirm);
   	    	}
		    //securityPopupWatcher.Watch(SSLRepo.Safari.ClientInfo, ConfirmSecurityWarningSF);
   	    	securityPopupWatcher.Start();   	    	   	    	    	    
        }
        
        public void ConfirmSecurityWarningCE(Ranorex.Core.Repository.RepoItemInfo myInfo, Ranorex.Core.Element myElement)
        {
            SSLRepo.GoogleChrome.PrivacySecurityWarnings.AddressAndSearchBar.PressKeys("{Tab}{Tab}{Tab}{Tab}{Enter}{Tab}{Enter}");        		
           	Validate.Exists(repo.GroovLoginAndLogout.LoginPanelInfo);              	        	
        }

        public void ConfirmSecurityWarningIE(Ranorex.Core.Repository.RepoItemInfo myInfo, Ranorex.Core.Element myElement)
        {
        	Report.Log(ReportLevel.Info, "This appears to be IE");
        	SSLRepo.InternetExplorer.PrivacySecurityWarnings.Overridelink.Click();
        	Report.Log(ReportLevel.Info, "Succesfully Accecpted Security Warning for Internet Explorer");        
        }
   
        public void ConfirmSecurityWarningFFAdd(Ranorex.Core.Repository.RepoItemInfo myInfo, Ranorex.Core.Element myElement)
        {
        	Report.Log(ReportLevel.Info, "This appears to be Firefox");
        	SSLRepo.Firefox.PrivacySecurityWarnings.FirefoxInitialWarning.IUnderstandTheRisks.Click();
        	SSLRepo.Firefox.PrivacySecurityWarnings.FirefoxInitialWarning.ExceptionDialogButton.Click();
        }
        
        public void ConfirmSecurityWarningFFConfirm(Ranorex.Core.Repository.RepoItemInfo myInfo, Ranorex.Core.Element myElement)
        {
        	SSLRepo.Firefox.PrivacySecurityWarnings.FirefoxPopupSecurityForm.PermanentlyStoreThisException.Uncheck();
        	SSLRepo.Firefox.PrivacySecurityWarnings.FirefoxPopupSecurityForm.ConfirmSecurityException.Click();
        	Report.Log(ReportLevel.Info, "Succesfully Accecpted Security Warning for Firefox");
        }
        
        public void ConfirmSecurityWarningMEConfirm(Ranorex.Core.Repository.RepoItemInfo myInfo, Ranorex.Core.Element myElement)
        {        	
        	Report.Log(ReportLevel.Info, "This appears to be Edge");
        	SSLRepo.MicrosoftEdge.Self.Click(Location.UpperRight);
       		SSLRepo.MicrosoftEdge.PrivacySecurityWarnings.SearchOrEnterWebAddress.PressKeys("{Tab}{Tab}{Return}");
        	Validate.Exists(repo.GroovLoginAndLogout.DivTagAppLogin);
        }
       
        public void CheckandConfirmSecurity()
        {
        }
                              
        
    }

Re: Microsoft Edge browser intial element recongition

Posted: Mon Dec 07, 2015 3:17 pm
by Support Team
Hello mtaylor,

Thank you for sharing your experience to our community.

Sincerely,
Robert