Python Selenium webdriver methods are getting failed with Timeout exception when a modal dialogue box is popped up - python-3.x

1)I am using python and selenium to test an invalid login scenario for a webpage authentication.
2)Once I am passing wrong credentials, a modal dialog appears on the screen.
3)After the dialog box pops up, any action I try to perform with the driver object , the command gets failed with Timeout exception.
4)I am unable to move the cursor nor click the ok button on the dialog box.
5)There is no iframe or alert message. Its a dialogue box.
6)The underlying code for webpage is in typesscript and html as markup lang
Can someone please guide?

Related

Cannot publish chatbot in Azure. After click "Direct line Channel" button, error is occurred

I make a chat bot on Azure, check on webchat test.
Webchat test is successful, as shown in the image below.
webchat test is success
For publishing this chat bot to Direct Line.
I click "constitute Direct Line channel" button in Channel category.(shown as below image)
click "Direct Line Channel" button
Clicked this button, transited ti error page.
This error page says "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.".(shown as below image)
enter image description here
This error also occur at other publishing button (teams,cortana,Slack...)
I cannot resolve this error.
Please tell me how to resolve this error.
Thank you.
Today, I click "Direct Line Channel" button, it work fine.
I think this matter is occuered by temporaly link error.

need to signin to the signin prompt after giving url in chrome using python script

How to handle the login pop up window using Selenium Webdriver? I have attached the sample screen here. How can I enter/input Username and Password to this login pop up/alert window?

how to click cancel in prompt box?

I am developing a chrome extension to suppress a prompt box.
The access is protected in server side and user is triggered with prompt box for username/password as shown below,
I am injecting a content_script in the url at document_start and trying to detect the presence of this prompt, if present "cancel" button need to be clicked.
Here is a test link to get the login prompt,
http://128.199.223.179/testing/test.php
You technically can't close the prompt only using the javascript api... You might need to use an NPAPI plugin or other external software such as Selenium to emulate a click on the close button.
But, what you can do is prevent that dialog from popping up in the first place by intercepting an authentication request.
First add "webRequest" permission in your manifest. Then try this code:
// to listen to all urls use { urls: ["<all_urls>"] }
chrome.webRequest.onAuthRequired.addListener(function(details) {
return {cancel: true};
}, {urls: ["http://128.199.223.179/testing/test.php"]}, ["blocking"]);
For better documentation, visit https://developer.chrome.com/extensions/webRequest#event-onAuthRequired

JSF Ajax session time out issue while opening a dialog box

Am developing a project using jsf2.2+primefaces 4.0,
I have an issue with opening dialog box even session timeout in jsf.
I have opened two tabs in same browser and in first tab am logged out from the session, in another tab(second) am opening a dialog box, it should be redirect to login but its opening a dialog.
How can I check if session is available or not while opening a dialog?
Please help me on this its great thankful to you.
Regards
Ravindra
You should use a SessionFilter to check if there is a logged user or not. In the doFilter() method of your SessionFilter, you should add this control:
if (session == null || session.getAttribute("id") == null) {
response.sendRedirect("/login.jsp");
}
And don't forget to configure your web.xml. This link may help you https://stackoverflow.com/tags/servlet-filters/info .

using Cucumber with Netzke to call an action in Grid Panel

I'm working on Rails(3.1.3) with Netzke(0.7.3).
I very new for Cucumber.
add_account_for_user.feature
Feature: Add Account For User Feature
In order to add login account
As an Administrator
I want to add login account for other role
Scenario: Adding Login Account
When I login as an Administrator
Then I should be on admin page
When I click on 'Administration' button at right upper of page
Then I should see 'Administrator Management'
And I should see 'Add' button in Administrator Management toolbar
When I click on 'Add' button
Then I wait 10 seconds # for check what happen
The problem is at When I click on 'Add' button step.
It pass but not working correctly. (It should fire event onAddInForm)
It's hanging in loading and do not show new windows panel.
my_steps.rb
Then /^(?:|I )click on '(\w*)'(?:|.*)$/ do |label|
click_link_or_button(label)
step "wait for the response from sever"
end
When /^(?:|I )wait for (?:.*)$/ do
page.driver.browser.execute_script(<<-JS)
JS
end
Found the solution!!
The solution is try to collect Component that you use. and then call that action directly.
When /I press 'Add' button in the '(\w*)' grid$/ do |grid_name|
page.driver.browser.execute_script <<-JS
var containerComp = Ext.getCmp("main_container");
var grid = containerComp.down("#"+"#{grid_name.underscore}_grid");
grid.onAddInForm();
JS
end
But I still don't understand why it not call onAddInForm after click.

Resources