0

I am unable to click login form element below site:

http://www.w-trading.co.kr/member/login.php?

I try:

driver.FindElement(By.XPath("//*[@id='memberId']")).SendKeys("my_id");

and

driver.FindElement(By.Id("memberId")).SendKeys("my_id");

but each code occur error.

How can I solve this problem? Thanks for your watching.

I'm using Selenium in C#.

2
  • What are the errors that you are seeing in each case?
    – Brian
    Jul 12, 2019 at 20:37
  • Are you sure the page is loaded when you executing click action? If not you have to wait until the page loads. Better share the error you get for this code
    – Syrus
    Sep 11, 2019 at 5:50

3 Answers 3

1

Do something more advance. Use a while that will wait for element.enabled to be true Inside the while do a try catch, in this try catch you will be asking if element enabled = true

The you do the click and then the send keys

1
  • You really should add a code sample to this.
    – Brian
    Aug 16, 2019 at 15:44
0

Try with :

  1. driver.FindElement(By.Id("memberID")).click();

  2. then driver.FindElement(By.Id("memberID")).sendKeys("Text");

0

You have 2 instances of the "memberId" Id attribute on the page. You need to interact with the second one.

Try this:

driver.FindElement(By.XPath("/descendant::input[@id='memberId'][2]")).SendKeys("my_id");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.