Module13 | Selenium Forum
A
Anjali C Posted on 07/12/2019

Please help with the FB friend question.

1)How do one locate the login button?

//*[@id="u_0_b"] is what I get from the chrome inspector right now but earlier this ID was different.
Is //input[@value="Log In"] a good choice?

2)Even after having the --disable--notification in the options,

ChromeOptions options=new ChromeOptions();
options.addArguments("--disable--notifications");
WebDriver driver=new ChromeDriver(options);
driver.get("https://www.facebook.com/");

 

how am I getting the below pop after login in?

 

 


A
Anjali C Replied on 07/12/2019

3) I copied the code form FB_FindFriend.java that was provided. It works fine sometimes, but throws "Exception in thread "main" org.openqa.selenium.NoSuchElementException" with below login page. How to handle 2 different types of login page?

 

Responsive image


A
Ashish Thakur Replied on 11/12/2019

Yes this is known as notification

Please look at video number 12. You need to use browser options class for this


A
Anjali C Replied on 11/12/2019

options.addArguments("--disable--notifications");

I hope this is the one you are talking about. I added these as mentioned in point 2) above, still getting the notification.

Please help with the rest of the questions as well.


A
Ashish Thakur Replied on 12/12/2019

 //input[@value="Log In"] a good choice? is good

 

For notification try this-

 
options.addArguments("--disable-notifications");- write like this
 


A
Ashish Thakur Replied on 12/12/2019

 //input[@value="Log In"] a good choice? is good

 

For notification try this-

 
options.addArguments("--disable-notifications");- write like this
 


A
Anjali C Replied on 14/12/2019

Thank you so much!