Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium C# how to get Element

Tags:

selenium

  <a href="javascript:;" class="btn green request-action-btn" data-request-status="Approved" data-id="212"> Approve </a>

How can I get this element in selenium C#. I tried by:href ,Xpath, ID, class name, text name but I couldn't get this element

like image 807
Marin Speed Daemon Avatar asked Jun 11 '18 10:06

Marin Speed Daemon


People also ask

Does Selenium support C language?

Selenium WebDriver is available in five official programming languages: Ruby, Java, Python, JavaScript, and C Language.

What is Selenium C# used for?

Selenium is an open-source, web Automation Testing tool that supports multiple browsers and multiple operating systems. It allows testers to use multiple programming languages such as Java, C#, Python, . Net, Ruby, PHP, and Perl for coding automated tests.

Can we use Selenium with C ++?

Webdriver++ is a C++ client library for Selenium Webdriver which you have to install and have the following feature support: Chainable commands. Value-like objects compatible with STL containers.

What is C sharp Selenium?

Selenium is an open-source Web UI automation testing suite. It was developed by Jason Huggins in 2004 as an internal tool at Thought Works. It supports automation across different browsers, platforms, and programming languages which includes Java, Python, C#, etc.


1 Answers

you can click by Link text

driver.FindElement(By.LinkText("Approve")).Click();

or by CSS Selector

.btn.green.request-action-btn
like image 104
Prany Avatar answered Sep 19 '22 23:09

Prany