Page 1 of 1

Problems with Ajax/Sharepoint Pop-Up

Posted: Fri Aug 19, 2011 12:53 pm
by Todor
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

Re: Problems with Ajax/Sharepoint Pop-Up

Posted: Fri Aug 19, 2011 1:31 pm
by Support Team
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

Re: Problems with Ajax/Sharepoint Pop-Up

Posted: Fri Aug 19, 2011 2:44 pm
by Todor
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");

Re: Problems with Ajax/Sharepoint Pop-Up

Posted: Sat Aug 20, 2011 10:43 am
by Support Team
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

Re: Problems with Ajax/Sharepoint Pop-Up

Posted: Mon Aug 22, 2011 8:28 am
by Todor
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 :)