Selenium Enter data in table multiple rows [closed]

0 votes

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;
}
}
Apr 11, 2020 in Selenium by Jyra
• 580 points

closed Apr 13, 2020 by Sirajul 689 views

Related Questions In Selenium

0 votes
2 answers

How can we use JavaScript Executor to click and enter data to a web element in Selenium?

WebElement element = driver.findElement(By.id("abcd")); // Let the ...READ MORE

answered Mar 21, 2020 in Selenium by Lakshmi Sarvepalli
1,486 views
+3 votes
1 answer

How to read excel file numeric data of all rows and column in selenium? I have 10 rows and 5 column but I read Only String value not a Numeric value?

Hey, @Mahendra, check this thread https://www.edureka.co/community/52170/read-numeric-data-from-excel-sheet-using-selenium-webdriver It deals with ...READ MORE

answered Jan 27, 2020 in Selenium by Sirajul
• 58,990 points
594 views
0 votes
0 answers

Selenium : how to Enter data in to tabular format frame - in horizontal way in UI

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, ...READ MORE

Apr 11, 2020 in Selenium by Jyra
• 580 points

closed Apr 13, 2020 by Jyra 276 views
0 votes
6 answers

How to specify "ENTER" button functionality in Selenium WebDriver code?

using OpenQA.Selenium.Interactions; Actions builder = new Actions(driver); ...READ MORE

answered Feb 12, 2019 in Selenium by anonymous
55,259 views
+2 votes
2 answers

How can I press ENTER key with the execute_script in selenium python?

The below code containing Keys.ENTER might just ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,520 points
19,443 views
0 votes
1 answer

Reading data from Excel in my Selenium test

Log4j problems are usually thrown because of ...READ MORE

answered Apr 6, 2018 in Selenium by nsv999
• 5,520 points
8,130 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,520 points
4,630 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,010 points
5,474 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
3,303 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,010 points
3,904 views