Instructor
gunjan Replied on 25/12/2018Can you please share the code
Sure will share it with you
public static void Main(string[] args)
{
try
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("URL");
driver.Manage().Window.Maximize();
driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(30);
Thread.Sleep(5000);
driver.FindElement(By.XPath("//div[@id='bs-example-navbar-collapse-1']/ul[2]/li/a")).Click();
Thread.Sleep(5000);
//calling before clcking
userCredentials();
//Process.Start(@"C:\Users\WindowsAuth.exe");
driver.FindElement(By.XPath("//li/a[@href='/TimeOffRequest/Account/SignInAsDifferentUser']")).Click();
Thread.Sleep(5000);
}
catch(Exception Ex)
{
Console.WriteLine("Message" + Ex.Message);
Console.ReadKey();
}
}
public static void userCredentials()
{
AutoItX3 aut = new AutoItX3();
//aut.WinWait("Sign in", "Chrome Legacy Window", 20);
//aut.WinActivate("Sign in");
//aut.Send("username");
//aut.Send("{TAB}", 0);
//aut.Send("password");
//aut.Send("{Enter}", 0);
I tried making it as executable..then its working by taking username and password but couldnt proceed by clicking on sign in..without AutoIT executable i tried with autoIT class that is also not working
Please help me in proceeding further
Thanks,
Durga.
Instructor
gunjan Replied on 07/01/2019
consider this sample autoit code for parametrizing the parameters:
Hi Gunjan,
Thanks for your response. Is this code to make it as executable or in selenium we can write in this way..can you explain the notations to me so that can apply as required.
Thanks,
Durga.
Can you elaborate it for me please, I couldnt understand completely the code parameters and used it as SciEditor to make it as exe and its not working..please help
Instructor
gunjan Replied on 08/01/2019
Its explained in the Module-14 video
Hi Gunjan,
Thanks for your response. I watched the videos in module 14 and found all the notations, but still while trying SSO with the above syntax its not working, So i tried below i was able to enter the username and password but Sign in am not able to handle either by controlClick or Send{"ENTER"} none are working to click the Sign In and enter into the required website. I tried by giving wait times and everything, But still no luck
Please look into the code and give you suggestions on this. I got stuck badly on this and couldnt proceed for my testing becz of this blocker issue.
Thanks,
Durga.