0

how can i capture src in following xml by using cssSelector or Xpath ?

<INPUT src="/TelsimGlobal/Menu/image3.gif" type=image>

i tried to execute following ones but always faced with "Unable to find element" error. any suggestion ?

driver.findElement(By.xpath("//img[@src='/TelsimGlobal/Menu/image3.gif']"));
driver.findElement(By.cssSelector("[src]"));                                
driver.findElement(By.cssSelector("a[src='/TelsimGlobal/Menu/image3.gif']"));

1 Answer 1

2

It is not an image (IMG) or a link (A) tag, it is a INPUT tag:

By.xpath("//input[@src='/TelsimGlobal/Menu/image3.gif']")
1
  • @santino87 Upvote or accept the answer if this/any answer is/was helpful to you for the benefit of future readers. see: stackoverflow.com/help/why-vote Commented Apr 16, 2019 at 8:27

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.