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 2,781 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 22, 2020 in Selenium by Lakshmi Sarvepalli
3,438 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
• 59,230 points
2,062 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 1,154 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 13, 2019 in Selenium by anonymous
96,103 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 28, 2018 in Selenium by nsv999
• 5,500 points
27,333 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,500 points
10,600 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,500 points
13,567 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,190 points
9,084 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,910 points
7,178 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 3, 2020 in Selenium by Sri
• 3,190 points
7,840 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP