TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vishal Dusane
1.3k
485
51.3k
how navigate Page to new link using Selenium webdriver C#.
Sep 20 2016 5:38 AM
Now i want to redirect the my current page to check new form of family details form so how can i do this
HTML code for family details link is
<
a
href
=
"/Admin/CountryMaintenanace"
>
<
span
>
Maintenance
</
span
>
</
a
>
using
System.IO;
using
System.Text;
using
OpenQA.Selenium;
using
OpenQA.Selenium.Chrome;
using
OpenQA.Selenium.Support.UI;
using
System.Drawing.Imaging;
namespace
eulogin
{
class
Program
{
static
void
Main(
string
[] args)
{
// Initialize the Chrome Driver
using
(var driver =
new
ChromeDriver(@
"C:\Users\v.dusane\Documents\Visual Studio 2012\Projects\ToolsQA"
))
{
// Go to the home page
driver.Navigate().GoToUrl(
"http://localhost:36000/login"
);
// Get the page elements
driver.FindElement(By.Id(
"UserName exampleInputEmail2"
)).SendKeys(
"Admin"
);
driver.FindElement(By.Id(
"Pwd exampleInputPassword2"
)).SendKeys(
"Admin@123"
);
driver.FindElement(By.Id(
"logid"
)).Click();
driver.FindElement(By.LinkText(
"/Admin/CountryMaintenanace"
)).Click();
// Take a screenshot and save it into screen.png
driver.GetScreenshot().SaveAsFile(@
"screen.png"
, ImageFormat.Png);
}
}
}
}
Reply
Answers (
2
)
Passing zip code to a url
how to reset c# session values from view