Telerik Forums
Testing Framework Forum
1 answer
172 views
I was working on generating my own Element Repository and I wanted to be able to create a page and set a property (in this case a link name) and find a span tag with the TextContent of that property. Unfortunately whenever a variable is used it ignores the TextContent expression and just finds the first span and returns that.

public HtmlSpan Link
{
    get
    {
        return Get<HtmlSpan>("TextContent=" + _link,"tagname=span");
    }
}

and

public class ExpressionDefinitions
{
    private HtmlFindExpression _link;
    public ExpressionDefinitions(string link)
    {
        string textcontent = "TextContent=" + link;
        _link = new HtmlFindExpression(textcontent, "tagname=span");
 
    }
    public HtmlFindExpression Link { get { return _link; } }
 
    public HtmlFindExpression LogOff = new HtmlFindExpression("tagname=button", "TextContent=Log Off");
}

I have tried various combinations of hard coded strings and variables and it appears only hard coded Strings work in these functions.  I don't know if it is an issue with the framework or a hole in my knowledge of c#.  Attaching the complete Pages class.
Cody
Telerik team
 answered on 06 Mar 2012
1 answer
121 views

Hi,
everybody

I am having a problem while handling IE8 download_complete window.The code I am using is below--

private bool DownloadExportedFile(string diskpath, FrameworkElement downloadButton)
  {
//download dialog handler 
     DownloadDialogsHandler downloadHandler = new DownloadDialogsHandler(Manager.Current.ActiveBrowser, DialogButton.SAVE, diskpath, Manager.Current.Desktop);
     Manager.Current.DialogMonitor.Start();
//trigger download event               
    downloadButton.User.Click();
//invoke handler
    downloadHandler.WaitUntilHandled(80000);
}

The code works fine for a particular file(.xlsx format,size 10.7 KB ) but when i use the same code for a different file(.zip format,size 342 bytes) it works as excepted for the initial download dialog and then for resulting save as dialog but it does not handle the resulting  download complete dialog as it does not click on its close button. As a result this window remains open.I am on windows 7 with ie 8.

Anthony
Telerik team
 answered on 05 Mar 2012
8 answers
581 views
Hello!

I have just migrated our solution to the 2011.2.1413.0 version and faced with the Open file dialog handling issue.

I have the code which works perfect with 2011.1.712.0 version.

 

 

 

var _fileUploadDlg = new FileUploadDialog(WebAii.Manager.ActiveBrowser,
   "fileName",
   DialogButton.OPEN,
   "Open");
WebAii.Manager.DialogMonitor.AddDialog(_fileUploadDlg);
WebAii.Manager.DialogMonitor.Start();
// click on some element to open dialog
_fileUploadDlg.WaitUntilHandled(30000);
WebAii.Manager.DialogMonitor.Stop();
WebAii.Manager.DialogMonitor.RemoveDialog(_fileUploadDlg);

With new 2011.2.1413.0 version the Open file dialog is appeared but the file is not selected. I have the error:

Message
System.TimeoutException : Timed out waiting '30000' msec. for any dialog to be handled '1'
Stack Trace
   at ArtOfTest.WebAii.Win32.Dialogs.BaseDialog.WaitUntilAnyHandled(IEnumerable`1 dialogs, Int32 handleCount, Int64 timeoutMilliseconds, Boolean resetHandleCount)
   at ArtOfTest.WebAii.Win32.Dialogs.BaseDialog.WaitUntilHandled(Int32 handleCount, Int32 timeout, Boolean resetHandleCount)
   at ArtOfTest.WebAii.Win32.Dialogs.BaseDialog.WaitUntilHandled(Int32 timeout)
...

Was the dialog handling approach changed? May be it is somehow related to the reported defect concerning ConfirmDialog and AlertDialog http://www.telerik.com/support/pits.aspx#/public/test-studio/9855  ?

Look forward to your advice.

Thanks.


OS Name Microsoft Windows XP Professional
Version 5.1.2600 Service Pack 3 Build 2600
IE Version 8.0.6001.18702
Andrey Cherepakha
Top achievements
Rank 1
 answered on 02 Mar 2012
3 answers
145 views
Hi,

I am not able to Retrieve text from "RichTextBox". While using the following piece of code it returns Empty string.

ActiveBrowser.Find.AllByType<RichTextBox>()[0].Text

and the following code also returns Empty string.

ActiveBrowser.Find.AllByType<RichTextBox>()[0].TextContent

The version of Framework would be "2011.1.609.0"

Thanks in advance,
Siva
Andrey Cherepakha
Top achievements
Rank 1
 answered on 02 Mar 2012
4 answers
168 views
Hi

I'm sometimes having problems starting IE, it happens maybe 1/200 times but it's quite annoying.

Is this a known issue? or is there something i can do to prevent this from happening, from what i can see it's Telerik that fails to detect the browser or something like that.

Info:
We are running a test suite of 50 tests multiple times a day and i see this maybe once or twice a day.


Error message:
Initialization method Iit.TradingFloor.TestWebUI.ErrorPageTests.TopTestInitialize threw exception. System.ApplicationException: System.ApplicationException: Exception thrown attempting to launch Internet Explorer. Please make sure Internet Explorer is properly installed and you are able to launch it. ---> System.TimeoutException: Wait for condition has timed out.

Error Stack Trace:
ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)
ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait)
ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Int32 timeout)
ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.WaitForIEFrameFromProcess(Process process, Int32 iWaitMilliseconds)
ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeout, ProcessWindowStyle windowStyle, String pipename)
ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeout, ProcessWindowStyle windowStyle, String pipename)
ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle)
ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect)
ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser()
Iit.TradingFloor.TestWebUI.BaseClasses.WebUITestBase.PrepareBrowser(Boolean clearCache, Boolean clearCookies) in C:\Source Control\0071 Trading Floor v3.0\Main\Source\TestWebUI\BaseClasses\WebUITestBase.cs: line 113
Iit.TradingFloor.TestWebUI.BaseClasses.WebUITestBase.TestInitialize() in C:\Source Control\0071 Trading Floor v3.0\Main\Source\TestWebUI\BaseClasses\WebUITestBase.cs: line 106
Iit.TradingFloor.TestWebUI.ErrorPageTests.TopTestInitialize() in C:\Source Control\0071 Trading Floor v3.0\Main\Source\TestWebUI\Tests\ErrorPageTests.cs: line 19


Martin
Top achievements
Rank 1
 answered on 02 Mar 2012
3 answers
88 views
Hi,

I am trying to open a new new on a button click from the browser, the new url opens in a new window however the parent browser automatically closes with the message "Internet explorere not responding". When debugged i get the following exception
ExecuteCommand failed!
InError set by the client. Client Error:
System.ArgumentException: Tag collection is either empty or has less elements than the element occurrence requested. RequestedIndex: '30', ElementLength: '29'
   at ArtOfTest.InternetExplorer.IECommandProcessor.FindElement(ElementIdMessage id)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessInformationCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Information',Info:'ElementRectangle',Action:'NotSet',Target:'ElementId (tagName: 'a',occurrenceIndex: '30')',Data:'',ClientId:'Client_c57cc8ce-55aa-4cb7-886e-89161445d243',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.ArgumentException: Tag collection is either empty or has less elements than the element occurrence requested. RequestedIndex: '30', ElementLength: '29'
   at ArtOfTest.InternetExplorer.IECommandProcessor.FindElement(ElementIdMessage id)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessInformationCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

Also the new browser is not connected giving manager.ActiveBrowser as null (resulting in object refrence )

Any help is highly appreciated.
Thanks
Cody
Telerik team
 answered on 01 Mar 2012
1 answer
60 views
Hi,

When have used Mouse click functionalities for RIght clicking on the context menu.
And also in some of the Text controls SetText proeprty doesn't set the value.So we are using Keyboard objects to type the keys in the required field.It works fine when we run them locally keeping the application open.

But we when we run these scripts on remote agents then scripts are failing as the windows will be minimised and Mouse and Keyboard operations are failing.

Please let us know if any alternatives can be introduced which avoids using Mouse/Keyboard functionalities.

Regards,
Hemashree
Anthony
Telerik team
 answered on 01 Mar 2012
2 answers
111 views
Hello to everyone.

We are using the latest version of testing framework (1413) and we have problems when we try to access items of a RadTreeListView. You can easily reproduce this bug if you run the TreeListVIewStructureTest that is in the example solution that installs with framework. See this Screenshot
We tested it and looks like actually the list view is found, but if you try to access TreeListItems, it gives this exception. 
It would be great if you could provide at least a workaround for this bug.
Cody
Telerik team
 answered on 01 Mar 2012
5 answers
215 views
Hi,

I use following code to handle HtmlInputFile Upload. But it is not working.
public void Upload(string filePath)
        {
            //((HtmlInputFile) TelerikHtmlWrapper).Upload(filePath, GlobalConst.FileUploadDialogTimeout);
            Manager manager = CoreManager.GetCurrentManagerObj();
 
            FileUploadDialog fDialog = new FileUploadDialog(TelerikHtmlWrapper.OwnerBrowser, filePath, DialogButton.OPEN);
 
            manager.DialogMonitor.Start();
            manager.DialogMonitor.AddDialog(fDialog);
 
            TelerikHtmlWrapper.Click();
            fDialog.WaitUntilHandled();
 
            manager.DialogMonitor.Stop();
        }

For IE9:
TelerikHtmlWrapper.Click()  Upload  dialog is shown but not processed and execution is hanging (Not even failing by timeout)
Issue is also reproducible if I use HtmlInputFile.Upload method instead of this code.

For FF9:
((HtmlInputFile)TelerikHtmlWrapper).Click() do not oped upload dialog. 
If I use HtmlInputFile.Upload method instead of this code Upload dialog is opened
but not processed, failing by timeout.




Anthony
Telerik team
 answered on 29 Feb 2012
11 answers
579 views

Hi Telerik team,

I want to hand all Confirm and Alert dialogs in multiple browsers (IE/Firefox/Chrome) automatically.
The following code is my implementation.

manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
 
public static void AddDialogHandlers(Manager manager, EventHandler dialogDisplayedHandler)
{
    manager.DialogMonitor.RemoveDialogs();
  
    //// Add dialog handler for ConfirmDialog.
    ConfirmDialog confirmDialog = ConfirmDialog.CreateConfirmDialog(manager.ActiveBrowser, DialogButton.OK);
    confirmDialog.HandlerDelegate = new DialogHandlerDelegate(MyCustomConfirmHandler);
    manager.DialogMonitor.AddDialog(confirmDialog);
  
    //// Add dialog handler for AlertDialog.
    AlertDialog alertDialog = AlertDialog.CreateAlertDialog(manager.ActiveBrowser, DialogButton.OK);
    alertDialog.HandlerDelegate = new DialogHandlerDelegate(MyCustomAlertHandler);
    manager.DialogMonitor.AddDialog(alertDialog);
  
    // Add more dialogs here...
  
    manager.DialogMonitor.Start();          
}
  
public static void MyCustomConfirmHandler(IDialog dialog)
{
    dialog.HandlerDelegate = null;
    dialog.Handle();
    dialog = null;
      
    Manager.Current.DialogMonitor.RemoveDialog(dialog);
  
    ConfirmDialog confirmDialog = ConfirmDialog.CreateConfirmDialog(Manager.Current.ActiveBrowser, DialogButton.OK);
    confirmDialog.HandlerDelegate = new DialogHandlerDelegate(MyCustomConfirmHandler);
    Manager.Current.DialogMonitor.AddDialog(confirmDialog);
}
  
public static void MyCustomAlertHandler(IDialog dialog)
{
    dialog.HandlerDelegate = null;
    dialog.Handle();
    dialog = null;
  
    Manager.Current.DialogMonitor.RemoveDialog(dialog);
  
    ConfirmDialog confirmDialog = ConfirmDialog.CreateConfirmDialog(Manager.Current.ActiveBrowser, DialogButton.OK);
    confirmDialog.HandlerDelegate = new DialogHandlerDelegate(MyCustomAlertHandler);
    Manager.Current.DialogMonitor.AddDialog(confirmDialog);
}

The dialogs are handled well in IE and Chrome, but both of them can't be handled correctly in Firefox.

In Firefox, the Confirm and Alert dialog just can be handled for the first time they display, and not handled any more from second time.

From debugging, I found that the MyCustomConfirmHandler and MyCustomAlertHandler methods are not invoked when the browser is Firefox. (They are invoked if the browser is IE or Chrome.)

Seems the Customized Dialog handle method does not work in Firefox.

So, is there anything else needs to do for Confirm and Alert dialogs in Firefox?

I'm looking forward for your feedback. Thanks.

Regards,
Jeffery

Jeffery
Top achievements
Rank 1
 answered on 27 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?