I have the following example where I'm trying to enter my credentials to login page. This is the code I'm trying to use:
System.Diagnostics.Process.Start("firefox.exe", "http://qa02.com");
WebDocument webDocument = "/dom[@caption='Log On']";
WebElement userName = webDocument.FindSingle("/dom[@domain='qa02.crowdtor.ch']//input[#'UserName']", 5000);
userName.PressKeys("developer");
It successfully types user name into the field but I'm getting the following exception:
"Thrown: "Could not load file or assembly 'mscorlib.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified." (System.IO.FileNotFoundException) Exception Message = "Could not load file or assembly 'mscorlib.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.", Exception Type = "System.IO.FileNotFoundException"
I was trying to find good examples online but could not find a lot.
Can you please point me to the right direction.
Thanks,
Nikolay
Don't want to use repository only Ranorex Xpath
-
- Posts: 42
- Joined: Fri Oct 04, 2013 9:47 pm
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Don't want to use repository only Ranorex Xpath
Hello,
It seems that the web document is not fully loaded.
Please try to add a 'WaitForDucumentLoaded()' method before you search for your input field.
You could try out the following code snippet:
Markus (T)
It seems that the web document is not fully loaded.
Please try to add a 'WaitForDucumentLoaded()' method before you search for your input field.
You could try out the following code snippet:
System.Diagnostics.Process.Start("firefox.exe", "http://qa02.crowdtor.ch"); WebDocument webDocument = "/dom[@caption='Log On']"; webDocument.WaitForDocumentLoaded(); WebElement userName = webDocument.FindSingle("/dom[@domain='qa02.crowdtor.ch']//input[#'UserName']", 5000);userName.PressKeys("developer");Regards,
Markus (T)
-
- Posts: 42
- Joined: Fri Oct 04, 2013 9:47 pm
Re: Don't want to use repository only Ranorex Xpath
Marcus, there is no userName.Clear function to clean text box before typing in it. Can you let me know if there is an easy solution for this? PressKeys("{Delete} 20"); will delete 20 characters. But we don't know how many of them. Not very nice solution.
Thanks,
Nikolay
Thanks,
Nikolay
Re: Don't want to use repository only Ranorex Xpath
You could do the following:
Mouse.Click -> UserNameField
KeyShortcut -> "Ctrl-A" (Selects all text)
KeyShortcut -> "Del"
KeySequence -> $YourText
Mouse.Click -> UserNameField
KeyShortcut -> "Ctrl-A" (Selects all text)
KeyShortcut -> "Del"
KeySequence -> $YourText
Shortcuts usually aren't...