Code to split a string and run in coded step

5 posts, 0 answers
  1. Abdul Khader
    Abdul Khader avatar
    22 posts
    Member since:
    Feb 2016

    Posted 23 Feb Link to this post

    Hi Team,

     

    Any advice on below issue :

     

    Requirement : In Coded Step, I want to write a code such that string should split into two halves based on delimiter and save it in two diff variables

    Any Code/Functionality available in Telerik Test Studio to achieve this ?

      

    Please find the snapshot for example

     

    Regards

    Abdul

     

  2. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 24 Feb Link to this post

    Hello Abdul,

    Is this number always contains 6 digits at the end? If yes you can use the following code:

    string code = "For DEMO purposes the current Mobile Phone code is: 085208";
    string newcode = code.Substring(code.Length - 6);
    Log.WriteLine(newcode);

    Please note that extracting from string is a general programming problem not related to Test Studio at all. Next time when you have a similar task you can look in MSDN or any other public resource on how to achieve it.

    Thank you for your understanding.

    Regards,
    Ivaylo
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Abdul Khader
    Abdul Khader avatar
    22 posts
    Member since:
    Feb 2016

    Posted 24 Feb in reply to Ivaylo Link to this post

    Thanks Ivaylo for quick reply.

     

    The other way I achieved this is with 'Split' function. However thanks for the code snippet.

     

    Also I have one other query for you

     

    Scenario is such that I need to select a value "V1" in Drop-down list "D1" and select value "V2" in Drop-down list "D2"

    Both the drop-downs are on same page and they have got same properties and list item values.(Image Attachment Included)

     

    In such cases, how can I select different item values of different drop downs on same page ?

     

     

     

  4. Abdul Khader
    Abdul Khader avatar
    22 posts
    Member since:
    Feb 2016

    Posted 24 Feb in reply to Abdul Khader Link to this post

    FYI .... I am new to Telerik Test Studio and C# language

     

    I am aware of 'Index' concept in general because I worked on QTP(UFT) and selenium

    How can we achieve same thing in Telerik Test or C# ? Please Advise

     

    Thanks

    Abdul

  5. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 25 Feb Link to this post

    Hello Abdul,

    You can use Test Studio recording function. Test Studio will record those steps automatically for you.

    Since you are new to Test Studio I suggest you to take a look at our documentation. Refer to the Getting Started section.

    Regards,
    Ivaylo
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top