What is the selenıum tools ?
One of the most important and critical processes of software development is
testing. Applications that can successfully pass many different tests such as
functional testing, performance testing, safety testing test can be used more .
so applications become free from mistakes and become fast There are many
software and tools available on the market today to improve and simplify
testing processes.for example Selenium. Selenium is an open-source, web Automation Testing tool that
supports multiple browsers and multiple operating systems
Selenium is a browser automation tool.so that is, some testing steps of
websites that is, a tool that allows you to automatically create and run some
test steps of websites through your web browser.
For example, if you want to test the regular and erroneous working
scenarios of the user registration page of your website, you can automate the
steps such as opening the user registration page with Selenium, filling in the
input fields on the page, clicking the button. That makes it easier for you to perform
functional tests of your application. By registering different scenarios in
this way, you can get these scenarios out of manual by making Selenium and
review the test results and say Selenium results are successful or there
are problems in some scenarios
WebDriver works on multiple browser
(c#,Java,Python) and multiple browsers (Chrome,Firefox).We'll use Selenium on
google chrome, using this artisle in c#.
Create Sample Project
After you open Visual Studio, follow the steps in File> New> Project. We
select and create the Unit Test Project
Adding
Selenıum Web Driver To Project
We will
use Nuget Package Manager to add Selenium in Visual Studio. we add
firefox or chrome according to the browser we use.
we need to
add these libraries to our project. Then we must required regulation to our testmethod1 called project.
IWebDriver driver = new ChromeDriver(); //For open
the browser (Google )
driver.Navigate().GoToUrl("https://epsg.io/transform#s_srs=5254&t_srs=4326"); // We
are want to do the process writing the
urls of the site
IWebElement elementx =
driver.FindElement(By.Id("srs-in-x"));
IWebElement elementy = driver.FindElement(By.Id("srs-in-y"));
// We set these codes according to the fields in the site
//If we want to use the name instead of id, the By.name should be written
instead of By.Id
describe the operations we will do to the elements as follows:For data
write elementname.sendKeys(“test”)
format.Click();
driver.close ();// when the transaction is
finished close the selenıum
We can look
at the above mentioned id names by making f12 from the site we want to convert.
After
writing our test project, right click and run "run test" to run the
project.









No comments:
Post a Comment