Facebook -- Error due to untraceable Notification alert | Selenium Forum
M
Posted on 14/04/2016
Hello Sir,

[b:3ji90ryd]Kindly see the screenshot.[/b:3ji90ryd]
Sir, I am getting an alert while logging in the application.
[b:3ji90ryd]And i get this alert only when i am automating the facebook site.[/b:3ji90ryd]
When i am manually loging in I am not getting this error.
And due to this alert all the test cases are failing.
I am not able to trace this alert,because it is not part of facebook home webpage.

Thanks.

M
Replied on 14/04/2016

use the Auto IT.


M
Replied on 15/04/2016

Kindly see the snapshot.
I am not able to record it even using AutoIT.
The syntax of AutoIT command to click is

ControlClick ( "title", "text", [b:7ba93zn4]controlID [/b:7ba93zn4][, button = "left" [, clicks = 1 [, x [, y]]]] )

[b:7ba93zn4]I got the title but I am not getting the control id for the alert[/b:7ba93zn4] . Control id of the button is the combination of Class & Instance.
On recording the click event AutoIt Finder tool is not generating any Class & Instance [I have attached the image in screenshot].

Then also i compiled ,it failed but I ran the script hoping for luck but eclipse is giving following error.

[b:7ba93zn4]Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (102, 66). Other element would receive the click: <div class="_3ixn"></div>[/b:7ba93zn4]

Kindly Help !!!

Responsive image

M
Replied on 15/04/2016

we'll try auto it if this alert class doesn't work.
http://www.seleniumeasy.com/selenium-tutorials/how-to-handle-javascript-alerts-confirmation-prompts


M
Replied on 15/04/2016

I have already tried with below code .

Alert alert=driver.switchTo().alert();
System.out.println(alert.getText());
alert.accept();

or

alert.dismiss();


M
Replied on 16/04/2016

send me the code you tried.


M
Replied on 17/04/2016

The AutoIt syntax for clicking is
ControlClick ( "title", "text", controlID [, button = "left" [, clicks = 1 [, x [, y]]]] )

[b:20h0mu9h]My Auto IT code is
ControlClick ( "https://www.facebook.com wants to:", "", "" ) [/b:20h0mu9h]

The tool finder gave me the title but not controlID, so i left it blank and tried but no success.
My next question is as AutoIT is used for desktop based application ,how can we use it to click on this alert ?


M
Replied on 17/04/2016

send me the entire selenium code.


M
Replied on 18/04/2016

Ya attached the code in Zip format and also mailed you on info@qtpselenium.com.


M
Replied on 18/04/2016

send esc key

driver.findelement(By.xpath("body")).sendKeys(Keys.ESC)


M
Replied on 20/04/2016

I tried it ,..
driver.findelement(By.xpath("body")).sendKeys(Keys.ESCAPE);
[b:ephxvvfb]Not Helpful[/b:ephxvvfb]

Still getting an error in eclipse as --

[b:ephxvvfb]
no such element: Unable to locate element:{"method":"xpath","selector":"body"}[/b:ephxvvfb]


M
Replied on 20/04/2016

do [quote:1z5z387g]driver.findelement(By.xpath("html/body")).sendKeys(Keys.ESCAPE);[/quote:1z5z387g]


M
Replied on 20/04/2016

Ya now it is working.
It removes the grey shadow on the login page making it workable now.
We can click the links and navigate it.

One thing, not a greater problem and matter of concerned the alert of show notifications still remains as it is .
Kindly see the snapshot.
Is it possible to remove that alert.

Responsive image

M
Replied on 20/04/2016

try to use now alert.switch to