Set FrameInfo programmatically

7 posts, 1 answers
  1. Hugues Ferland
    Hugues Ferland avatar
    14 posts
    Member since:
    Oct 2009

    Posted 04 Oct 2010 Link to this post

    Hi,

    I'm currently setting up a small framework/layer to manage environment switching, ensuring that any change we do, say in Dev, will still be ok in Acceptance, Preprod, Prod, etc.  Everything working except for cases where we use a FrameRadWindow popup.  I found out the frame information is stored in a property named FrameInfo but I cannot find how to programmatically change this property.  I need to change the 'src' and the 'BaseUrl' properties because the base folder varies depending of the current environment.  How can I do that ?

    Regards,

    Martin L.
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 04 Oct 2010 Link to this post

    Hello Pascal Guy,

    The framework will automatically override the BaseURL property of frames with the Base URL setting of from the File Paths tab of the that's contained in the test settings. See the attached screenshot. It can also be set programmatically like this:

    Manager.Settings.BaseUrl = "http://demos.telerik.com";


    The Src property really can't be modified programmatically. Can you somehow modify the FrameInfo so it doesn't rely on the src attribute?

    Kind regards,
    Cody
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Hugues Ferland
    Hugues Ferland avatar
    14 posts
    Member since:
    Oct 2009

    Posted 05 Oct 2010 Link to this post

    Hi,

    I tried using the suggested solution like so in the coded step with a Frame element :
    // Set the popup url
    Manager.Settings.BaseUrl = "/MyWebsite/Content/Unit/BatchAssignment/MusicInstrumentBatchAssignation.aspx";
     
    // RadGridDataItem: check box click item '0' selection.
    Pages.MusicInstrumentView.FrameRadWindowCadetList.TableCell.ClientSelectCheckBoxClick();
     
    // Set back the BaseUrl to old value;
    Manager.Settings.BaseUrl = m_OldBaseUrl;

    Unfortunately, the test runner doesn't seem to take account the baseUrl I am setting and the request times out without finding the element I am looking for.

    The objective I am trying to achieve here is changing the test environment url.  This must be a very common issue I am sure there must be some cleaner way to do it.  Here's a little bit more info on our setup so you can understand better. One thing you must know is the difference between two test environments can be the Website folder.

    Example :

    Dev env : http://localhost/MyTestWebsite/content/home.aspx
    Acceptance env : http://acceptance.mycompany.net/content/home.aspx
    Prod env : https://www.mycompany.net/content/home.aspx

    In the Element Explorer, I can see the frames used for my RadWindows.  The FrameInfo BaseUrl property is harcoded with /MyTestWebsite/content/home.aspx.  I want to make sure I create tests that can be executed against any of these environments. 

    Hope this is a little clearer,

    Cheers,

    Martin L.


  4. Answer
    Cody
    Admin
    Cody avatar
    3360 posts

    Posted 06 Oct 2010 Link to this post

    Hello Pascal Guy,

    I think there's a MUCH easier way and you don't even have to resort to code. In the FrameInfo properties you can use a "partial match" by preceeding the BaseURL with a ~ as shown in the attached screenshot. The ~ means match a URL that contains the specified text anywhere in the entire URL.

    All the best,
    Cody
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Hugues Ferland
    Hugues Ferland avatar
    14 posts
    Member since:
    Oct 2009

    Posted 07 Oct 2010 Link to this post

    Thanks, that's perfect !
  6. dan
    dan avatar
    27 posts
    Member since:
    Jun 2016

    Posted 27 Jul in reply to Cody Link to this post

    Hi Cody,

    Can the FrameInfo  src property be partially matched using ~, as well?

     

    thx,

    dan

  7. Boyan Boev
    Admin
    Boyan Boev avatar
    1043 posts

    Posted 03 Aug Link to this post

    Hello Dan,

    Yes it can be be partially matched using ~.

    Let us know if you need further assistance.

    Regards,
    Boyan Boev
    Telerik by Progress
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!