Stuck in a Get/Set/ extract

2 posts, 0 answers
  1. Rahul
    Rahul avatar
    12 posts
    Member since:
    Mar 2018

    Posted 01 May Link to this post

    Hi, I am fairly new to coding. I am trying a very simple scenario but it's not working so need your assistance.

    My scenario is i am on Pre-Login page which contain 3 fields Id, Password & Submit respectively. Now i want to fill ID via coded step. The code which i write is 

    object myid = GetExtractedValue("Username");  
     string myid = "rahul.pathak@bcdme.com";
     SetExtractedValue ("Username", myid);

    My expected result is if i run till this step. ID will be filled by itself. Instead i am getting "Build Failed".

     

  2. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    942 posts

    Posted 04 May Link to this post

    Hi Rahul,

    Thank you for reaching us out. 

    Please note that you first need to set value to a variable and then use it. So first you need to use SetExtractedValue to define the a variable named Username and assign to the value of the string myid

    As far as I understand you would like to set the username in coded step. What is the reason to use an extracted variable? You could simply locate the input field and then use SetText method to set text to it. 

    If the above information is not sufficient I would like to kindly ask for some further details on the exact scenario you need to cover. Thanks in advance! 

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