Watin - problems with page redirects - watin

I'am trying out Watind. I am having problems with a Login page og the applciation, which automatically redirects to the main page (without any user intervention). It looks like WatiN has troubles with this. Wehn I Invoke:
IE ie = new IE("http://localhost/MyApp/Login.aspx");
The browser opens, it redirects to "Main.aspx", but Watin times out with "Timeout while Internet Explorer state not complete". While debugging, I have found out, that method IEReadyStateIsComplete. When trying to evaluate ie.ReadyState, its is getting the following exception from ie: "The Object has disconnected from its clients".
I am using IE8.
Any ideas how to handles fast redirects?
Matra

It looks like the problem was related to UAC feature of Window 2008 server. I'have restarted VS200 as an Administrator and now it works OK.

Related

Selenium cannot find elements on Google service while minimalised or headless mode

I try to create a program which will automate fetching data from one of the Google services. By using chrome and watir (which is basically a Ruby library build on top of the Selenium). Everything works fine as long as I keep my browser open. But when I minimize window, my program is not even able to pass a login process since it cannot find certain elements. This is my code to login:
#browser = Watir::Browser.new :chrome, options: { detach: true }
#browser.goto BASE_URL
#browser.text_field(name: 'identifier').set USER_EMAIL
#browser.element(xpath: '//*[#id="identifierNext"]').click
#browser.text_field(xpath: '//input[#type="password"]').set USER_PASSWORD
#browser.element(xpath: '//*[#id="passwordNext"]/div/button/div[2]').click
When my browser is minimize, during attempt to set a password I get this error message:
*** Watir::Exception::UnknownObjectException Exception: element located, but timed out after 30 seconds, waiting for
#<Watir::TextField: located: true; {:xpath=>"//input[#type="password"]", :tag_name=>"input"}> to be
present
And it works just fine as an open window. Even if I maximize the window during whole process program is suddenly able to locate missing input fields. The same story goes in many other points further. Program is not able to locate some elements unless chrome window is open.
Needless to say it works even worse in headless mode and I'm basically not able to locate any of those elements in html code.
As far as I understand Google services frontend side are build with Angular framework which inject html code dynamically. But shouldn't selenium pretend to act like a regular user and trigger the same responses on minimized and open window (and the headless mode as well)?
Is is some kind of blockade from Google to prevent this kind of automated proces and how can I bypass it?
Is this an issue with Chrome and switching for e.g. Firefox would fix it?
Can I implement some additional actions to actually mimic human interaction and pretend that my Chrome window is open?

Script issue in J Meter while recording script using 'BAD BOY' tool

Chrome Settings
HI All - I am new to J meter and i am continuously getting the script error while recording the script using bad boy tool.
I tried with the changing the chrome settings as above:
but still am getting the same script error.
I hope when you normal browse the application then your are not getting the error.
So, if you are recording and getting pop-up but you can proceed further then record your action and suppress the javascript error from Preference>Automatically handle>Javascript Error Dialogs.
You can also disable recording javascript request from Preferences>Recording option. Since, jmeter work on request and response and not GUI level so javascript is not supported. It does not actually parse/execute JavaScript coming with the loaded page.
Also, try the option you have shown to disable script in IE browser and then try with chrome.
Hope this helps.

CanĀ“t open an internal page in Cypress Chrome

We have an cypress issue that is similar to the issue described in "https://github.com/cypress-io/cypress/issues/850". The reason for why I am creating a new post is that I have done some changes in the environment which makes this work but only after the first fail and then manually click on the failing URL.
Test1:
Default cypress\plugins\index.js file (no changes)
lauch the internal page cy.visit('xxx')
Error 401.
Click on the link below the error text. Another tab is opened and message UNAUTHORIZED is shown.
Paste same URL in default Chrome->works fine.
Test2:
Modify the cypress\plugins\index.js: args.push('--proxy-pac-url=xxx') (I have tested other arguments but this is the only one that makes something different)
Lauch the internal page cy.visit('xxx')
Error 403.
Click on the link below the error text. Another tab is opened and the page is shown CORRECTLY.
This is the reason why I post this new message. I want to ask if there is a way to get Cypress to open the page automatically via cy.visit() in the same way as when I click on the failing URL and it opens the page in the same cypress browser but just another tab?

How to see the debug internal server errors when there is an error in POST done via AJAX in Django

I have defined many views doing 'manual' ajax processing like:
#require_POST
def do_something(request, ...)
....
<some code that bugs>
...
How to get the normal django stacktrace page out of this?
Because of limitations of my current setup (Django is run on a remote host using PyCharm remote debugger and the project is on a NFS share) stopping the server and restarting the server under debugger is not the optimal solution, especially because most of the problems would be easily spotted from the django error page with stacktrace and local variables.
Any other debugging ideas also welcome.
You can view any ajax response in separate "window" with either Firefox or Google Chrome. In Chrome it is the Network tab in developers console.

Watin's LogonDialogHandler not working for Firefox 3.6

I'm writing automation scripts for a website using WatiN. when I browse to a particular url, a authentication dialog pops up. I have following code to handle the dialog. This code basically enters the specified
// Create a logon dialog handler
LogonDialogHandler ldh = new LogonDialogHandler(user, password);
browser.DialogWatcher.Add(ldh);
browser.GoTo("URL that pops up the authentication dialog");
Now this works just fine in IE. But in Firefox, the dialog appears and nothing happens after that. (No username or password entered in their text boxes)
Any idea what's going wrong here?
I'm sorry but the automation of firefox popups/dialogs is not supported by WatiN at this moment (WatiN 2.1 and lower). It probably can be done but this is not high on my priority list.

Resources