My List<Map<String,String>> Has below Data :
[{Test_Case_id=tc1, Delimiter=|,SourceFile=/tmp/tes.dat,targetFile=/tmp/tgt.file},
{Test_Case_id=tc2, Delimiter=;,SourceFile=/tmp/tes1.dat,targetFile=/tmp/tgt1.file},
{Test_Case_id=tc3, Delimiter=|,SourceFile=/tmp/tes2.dat,targetFile=/tmp/tgt2.file}]
In UI page, I have to enter these values in the table. the table looks like below
//<Header>
Test_Case_id Delimiter SourceFile TargetFile
<Input Box> <Input Box> <Input Box> <Input Box>
<Input Box> <Input Box> <Input Box> <Input Box>
<Input Box> <Input Box> <Input Box> <Input Box>
With the code below, it is writing data in the horizontal format
Test_Case_id Delimiter SourceFile TargetFile
tc1 tc2 tc3 <Input Box>
<Input Box> <Input Box> <Input Box> <Input Box>
<Input Box> <Input Box> <Input Box> <Input Box>
int counter =1;
for (WebElement inputhd: inputHeaders)
{
for (Map<String,String> fetchrow : fetchfilteredrows) // in fetchfilterdrows the above List<Map<String,String>> data is tored.
{
for (Map.Entry<String,String> entry : fetchrow.entrySet())
{
if(input.getText().equalsIgnoreCase(entry.getKey().trim()))
{
//////for (i=0; i<fetchfilteredrows.size(); i++)
{
WebElement inputText = inputhd.findElement(By.xpath(".following::input["+counter+"]"));
WebElement.EnterText(inputText, entry.getValue().trim());
//////}
}
}
counter =counter+1;
}
}