4 posts, 0 answers
  1. Pete
    Pete avatar
    4 posts
    Member since:
    Sep 2012

    Posted 12 Mar 2013 Link to this post

    do you have any code samples for coding against radupload in code behind file of test?
  2. Byron
    Byron avatar
    184 posts

    Posted 15 Mar 2013 Link to this post

    Hello Pete,

    We do not have code samples specific to the RadUpload control. However, recording against a RadUpload control results in a RadControl translator step for the file select button, customized in code as this:

    // RadUpload('ctl00_ContentPlaceHolder1_RadUpload1'): input file 0 select

    and a standard Test Studio FileUpload dialog handler for the upload step. Please let us know if you have a specific testing scenario we can assist with. 

    All the best,
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Myo
    Myo avatar
    1 posts
    Member since:
    Sep 2013

    Posted 16 Oct 2013 Link to this post

    Hello Byron,

    I tried code step from the link  Handling FileUpload Dialogs but not able to compile. Directive or Assembly references are missing for Find.Elements["uploadfile"].GetRectangle() and new Point(-10, 0) suppose to get zero argument but it has two arguments which make compilation errors..

    Can we automate as data driven for radupload dialog file selection?

    Thanks in advance,
  4. Velin Koychev
    Velin Koychev avatar
    88 posts

    Posted 21 Oct 2013 Link to this post

    Hi Pete,

    I am sorry to hear that  you are experiencing this issue.

    You can also use the following complete code sample that you can test against a public website:
    Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
                FileUploadDialog x = new FileUploadDialog(ActiveBrowser, @"C:\Test.txt", DialogButton.OPEN);
                HtmlInputFile choose = Find.ById<HtmlInputFile>("uploadname1");
                HtmlInputButton button = Find.ById<HtmlInputButton>("uploadbutton");

    You should be also able to automate radupload dialog file selection as data driven. If you are using the free Telerik Testing Framework and Visual Studio, you will need to follow their directions for creating a data driven test. If you are using Test Studio you need first to Bind the test to an external data source and then write the code in a coded step:

    // You can reference the column by index
    string fileLocation = (string)Data[0];
    // Or by name
    string fileLocation2 = (string)Data["Files"];

    If you need additional assistance please do not hesitate to contact us and give us more details about your testing scenario.

    Velin Koychev
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top