Microsoft Edge browser intial element recongition

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
mtaylor
Posts: 10
Joined: Wed Feb 11, 2015 5:36 pm

Microsoft Edge browser intial element recongition

Post by mtaylor » Fri Nov 20, 2015 7:34 pm

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]
Attachments
RanorexIssue.JPG
RanorexIssue.JPG (40.67 KiB) Viewed 1371 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Microsoft Edge browser intial element recongition

Post by Support Team » Tue Nov 24, 2015 11:11 am

Hello mtaylor,

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

Hope this information helps.

Sincerely,
Robert
.
Image

mtaylor
Posts: 10
Joined: Wed Feb 11, 2015 5:36 pm

Re: Microsoft Edge browser intial element recongition

Post by mtaylor » Fri Dec 04, 2015 11:39 pm

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]
Attachments
Capture.JPG
Capture.JPG (58.58 KiB) Viewed 1322 times

mtaylor
Posts: 10
Joined: Wed Feb 11, 2015 5:36 pm

Re: Microsoft Edge browser intial element recongition

Post by mtaylor » Sat Dec 05, 2015 12:51 am

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()
        {
        }
                              
        
    }

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Microsoft Edge browser intial element recongition

Post by Support Team » Mon Dec 07, 2015 3:17 pm

Hello mtaylor,

Thank you for sharing your experience to our community.

Sincerely,
Robert
.
Image