- pushpendra.j.singh
- Posts : 1
Join date : 2014-07-04
how to find element by attribute in webdriver
Fri Jul 04, 2014 5:01 pm
hi
how to find element by attribute in webdriver
how to find element by attribute in webdriver
- anemudayActive particpant
- Posts : 11
Join date : 2012-10-11
Re: how to find element by attribute in webdriver
Thu Jul 10, 2014 6:05 pm
If i am not wrong, you can identify objects with only following identifies only:
className, cssSelector, id, xpath,linkwithtext,name,tagName.
So you cannot identify objects with Attribute.
className, cssSelector, id, xpath,linkwithtext,name,tagName.
So you cannot identify objects with Attribute.
- mail2prassadAmateur
- Posts : 41
Join date : 2013-06-05
Re: how to find element by attribute in webdriver
Fri Jul 18, 2014 7:25 pm
I think we can find the element by attributes,
for example
We can identify the above element as
WebElement elemm = driver.findElement(By.xpath("//div[contains(@onclick, 'testfunction')]"));
for example
- Code:
<div onclick="testfunction()">
</div>
We can identify the above element as
WebElement elemm = driver.findElement(By.xpath("//div[contains(@onclick, 'testfunction')]"));
- ravindarreddy.nalla
- Posts : 5
Join date : 2014-07-19
Re: how to find element by attribute in webdriver
Sat Jul 19, 2014 12:16 am
Yes. We can identify the object :
CODE:
We can identify the above element as
WebElement elemm = driver.findElement(By.xpath("//div[contains(@onclick, 'testfunction')]"));
CODE:
- Code:
<div onclick="testfunction()">
</div>
We can identify the above element as
WebElement elemm = driver.findElement(By.xpath("//div[contains(@onclick, 'testfunction')]"));
- Unable to find an element by Id, Name or Xpath using the Webdriver of IE for my webpage
- Selenium 2 Webdriver cant find element by xpath after upgrading from firefox 3.6 to 5
- Find and click a span element value
- Need help to identify the Element
- c# webdriver - Data Driven : DataSource attribute error - Connecting Automation with MTM
Permissions in this forum:
You cannot reply to topics in this forum
|
|