Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7738649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:19:18+00:00 2026-06-01T08:19:18+00:00

I am working with Selenium RC. I am giving the data manually to selenium.Like

  • 0

I am working with Selenium RC.

I am giving the data manually to selenium.Like below

selenium.type("id=username","myName");
selenium.type("id=password","myPassword");
selenium.click("id=login");

But, my doubt is is there any way to get the data dynamically? Here I am giving my Name directly into selenium.type();

Is there any way to retrieve username and password from other place like textfile or excel file?

Any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:19:20+00:00Added an answer on June 1, 2026 at 8:19 am

    Short answer – YES.

    Longer answer – You need to program it. So it is not possible using Selenium IDE, but you can use Selenium Webdriver. I am doing this in Java, so I will post you little snippets of my code, how do i do it.

    1) I have special Java Class to hold the user information:

     public class EUAUser {  
    
      private String username;
      private String password;
      private boolean isUsed
    
      public EUAUser(String uname, String pwd){
        this.username = uname;
        this.password = pwd;
        isUsed = false;
      }
    
       public String getPassword(){
        return password;
       }
    
     public String getUsername(){
        return username;
     }
    
     public void lockUser(){
         isUsed = true;
     }
    }
    

    2) Then I have UserPool to hold all users. So far because I need only 5 different users, I do it by quick and dirty approach:

     public class UserPool {
    private List<EUAUser> userList = new ArrayList<EUAUser>();
    
    public UserPool(){
    
              userList.add(new EUAUser("firstUser","a"));
              userList.add(new EUAUser("MyUsername", "a"));
              userList.add(new EUAUser("TestUser", "a"));
              userList.add(new EUAUser("TSTUser2", "a"));
    
           }
    
      public EUAUser getNextUser() throws RuntimeException {
        for(EUAUser user: userList){          
              if (!user.isUsed()){
                  user.lockUser();
                  return user;              
          }
        }
        throw new RuntimeException("No free user found.");
    }
    

    3) In tests I have something like this

     UserPool pool = new UserPool();
     EUAUser user = pool.getNextUser();
     selenium.type("id=username", user.getUserName());
     selenium.type("id=password", user.getPassword());
     selenium.click("id=login");
    

    The above code does

    1. Add all known users to the UserPool
    2. Retreive one free user from the pool
    3. logs him into the app under username and password

    In my case its really quick and dirty approach, but you can have list of users in file and load them into the UserPool using fileReader or something. Just giving you idea how you can do this 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with selenium. while trying to click a button it creates a pop
I'm working on a project which is using Selenium and I'd like to try
I'm working with Selenium 2 WebDriver in Eclipse and everything works fine. But when
I'm working with Selenium right now, and I'd like to know if it's possible
We have Capybara working with the selenium driver but when I try to use
I am working on function testing using selenium. But on GUI testing I need
following code is write are not: selenium.GetEval(document.getElementsByTagName('a')[1].innerText); actually other scripts are working fine like
Currently I am working on selenium IDE, now I need to switch to selenium
I'm working on a project using Scala running Selenium tests as part of a
The company I'm currently working for is using Selenium for Uniting-Testing our User Interface.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.