Problems with Ajax/Sharepoint Pop-Up

Ask general questions here.
Todor
Posts: 66
Joined: Mon Jul 25, 2011 11:28 am

Problems with Ajax/Sharepoint Pop-Up

Post by Todor » Fri Aug 19, 2011 12:53 pm

As I don't want to work with Delays when I open a pop-up I tried using Code instead of it.

Code: Select all

	        Report.Log(ReportLevel.Info, "before search");
        	for(int i = 0;i < 10;i++) 
        	{
        		Element o = null;
        		repo.Servicedesk.test.TryFindSingle(".", out o);
        		if(o != null) 
        		{
		        	Report.Log(ReportLevel.Info, "found");
        			break;
        		}
	        	Report.Log(ReportLevel.Info, "before delay");
	        	Delay.Duration(100);
	        	Report.Log(ReportLevel.Info, "in delay");
        	}
        	
        	Report.Log(ReportLevel.Info, "after");
repo.Servicedesk.test = "body/div[1]/div/div[2]/iframe"

but the code finds the Pop-Up before it is loaded and fails when executing the next code.

In the picture there is the pop-up window and the other attachment is a snapshot of the site while the pop-up is opened.

Looking forward hearing from you

P.S.: I have read the User Guide concerning how to handle AJAX
Attachments
Snapshot_PopUp.rxsnp
(545.05 KiB) Downloaded 145 times
Popup.gif
Popup.gif (329.33 KiB) Viewed 2057 times

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

Re: Problems with Ajax/Sharepoint Pop-Up

Post by Support Team » Fri Aug 19, 2011 1:31 pm

Hi,

You want to wait until the pop-up window appears, so you can do this by adding a "Validation" step.
You can validate a specific name of a button from the pop up window.
For instance:
Validate.Attribute(repo.YourDocument.YourIFrame.TheSpeicherButtonInfo, "Text", "Speichern");
The Validation action waits until the specific button is visible.
After this step you can perform your other actions.

Regards,
Markus
Ranorex Support Team
.
Image

Todor
Posts: 66
Joined: Mon Jul 25, 2011 11:28 am

Re: Problems with Ajax/Sharepoint Pop-Up

Post by Todor » Fri Aug 19, 2011 2:44 pm

Are the regular RanoreXPath Expressions working in the Validate.Atribute() Method working too?

Example:

Code: Select all

Validate.Attribute(repo.Servicedesk.AjaxDropDown, "class", "RadComboBoxDropDown.*");
// instead of
Validate.Attribute(repo.Servicedesk.AjaxDropDown, "class", "RadComboBoxDropDown RadComboBoxDropDown_Default");

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

Re: Problems with Ajax/Sharepoint Pop-Up

Post by Support Team » Sat Aug 20, 2011 10:43 am

Todor wrote:Are the regular RanoreXPath Expressions working in the Validate.Atribute() Method working too?
There is an overload of the Validate.Attribute taking a standard .NET regular expression instead of a pure string argument:
Validate.Attribute(repo.Servicedesk.AjaxDropDown, "class", new System.Text.RegularExpressions.Regex("RadComboBoxDropDown.*"));
If you don't know the code to write for a specific action, just create that action with the Ranorex Recorder and have a look at the code the recorder generates. Then you don't have to wait for Ranorex support to answer your question in the forum :D

Regards,
Alex
Ranorex Team
.
Image

Todor
Posts: 66
Joined: Mon Jul 25, 2011 11:28 am

Re: Problems with Ajax/Sharepoint Pop-Up

Post by Todor » Mon Aug 22, 2011 8:28 am

Well, I did not know that it's possible to make a validation-step with the recorder, but thanks for the hint. I'll try it next time :)