This is a migrated thread and some comments may be shown as answers.

Stuck in a Get/Set/ extract

1 Answer 57 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 01 May 2018, 04:55 PM

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".

 

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 04 May 2018, 02:09 PM
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!
Tags
General Discussions
Asked by
Rahul
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or