Not able to store System Generated values | Selenium Forum
M
Posted on 26/11/2015
[b:uiy6unw8][u:uiy6unw8]I have tried below code for to fetch the auto generated UID but not able to store the value which is dyanmically generated after clicking on the Generate button (Please Refer attachment)[/u:uiy6unw8][/b:uiy6unw8]


public String WaitUntilTextPresent(String object, String data){

apps_logs.debug("click on Generate UID button");

try{
WebDriverWait wait = new WebDriverWait(driver, 120);
wait.until(ExpectedConditions.textToBePresentInElementValue(By.xpath(OR.getProperty(object)), "Time left: 50 seconds"));
}catch(Exception e){
return Constants.KEYWORD_FAIL+"--value is not generated--"+e.getMessage();

}
return Constants.KEYWORD_PASS;
}

M
Replied on 27/11/2015

i am not sure what you're asking. can you please repeat the question.


M
Replied on 28/11/2015

Actually, as per the screen shot attached, as we click on the "Generate" button the Unique ID will automatically generated and populated in the given text box,
and i wants to get/print that populated value? so how can we do this? also it is taking time(up to 2 minutes) to populate the value in the text box.

I have tried above code for the same but not able to get the value.


M
Replied on 28/11/2015

[quote="vivekugale":a8abylcn]Actually, as per the screen shot attached, as we click on the "Generate" button the Unique ID will automatically generated and populated in the given text box,
and i wants to get/print that populated value? so how can we do this? also it is taking time(up to 2 minutes) to populate the value in the text box.

I have tried above code for the same but not able to get the value.[/quote:a8abylcn]

driver.findelement(by.xpath("xpath/to/textbox")).gettext();