Hi,
Well I just inspected through the (inspect element ) this is the code I am not sure if its in frame .
<button onclick="FBLoginReady(0);" class="face-login-btn"><div class="fa icon-facebook icon-facebook-logo"></div>
<span>Login with Facebook</span></button>
Hi,
I am currently in another system I work in two and I found out that its a MODAL POPUP ,so how do you handle this in selenium webdriver .
Thank you
lilly.k
Hi ,
I have used the snipping tool so please see the attached document .
Thanks
lilly.k
Hi Ashish,
Please find the code here I have tried I dont know what mistake I am making but its not working .
[code:1joaje8r]import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.interactions.Actions;
public class Drivers {
public static void main(String[] args) {
FirefoxProfile prof = new FirefoxProfile();
prof.setEnableNativeEvents(true);
WebDriver driver=new FirefoxDriver();
Set<String> windowIds=driver.getWindowHandles();
System.out.println("Total window opened --> "+ windowIds.size());
Iterator<String> it = windowIds.iterator();
System.out.println(it.next());
driver.get("http://quikr.com");
driver.manage().window().maximize();
driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);
driver.findElement(By.id("csclose")).click();
driver.findElement(By.xpath("//*[@id='logindiv']/ul/li[1]/a")).click();
WebElement rootNode=driver.findElement(By.xpath("//*[@id='signInSignUpHtml']/div"));
Actions act = new Actions (driver);
act.moveToElement(rootNode).build().perform();
driver.findElement(By.xpath("//*[@id='signInSignUpHtml']/div/div[2]/button")).click();
[/code:1joaje8r]
This is the code i am still not getting the mouse to click the facebook button that appears on the modal popup .
I am able to close the modal popup that appears first and and then click on the signin/Register link to move on to the next window or I am still not able to figure out what it is looks like a modal popup but not able to get the mouse to click that.
Let me know what mistake I am doing here . I will try it out .
Thank you
lilly.k
Try following code, it will work:
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
public class quickr {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "D:\\Selenium Work\\Driver\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://quikr.com");
driver.manage().window().maximize();
driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);
driver.findElement(By.id("csclose")).click();
driver.findElement(By.xpath("//*[@id='logindiv']/ul/li[1]/a")).click();
WebElement rootNode=driver.findElement(By.xpath("//*[@id='signInSignUpHtml']/div/div[2]/button"));
Actions act = new Actions (driver);
act.click(rootNode).build().perform();
}
}
HI ,
First I thank you for your response .I appreciate it .Well I tried it but still not working this particular line says
Type mismatch cannot convert from void to webElement .
So I dont really know if you got this error so could you please check it .
WebElement rootNode=driver.findElement(By.xpath("//*[@id='signInSignUpHtml']/div/div[2]/button"));
Thank you
lilly.k
Hi lilly,
I am not sure why you are getting this error. It is working fine on my machine. Just try with latest selenium version.
Hi,
I tried it but still its not working I just tried with robot but need some help to complete it .Its a modal popup which selenium webdriver cannot handel and I guess we need to use robot . so if you can please check it out and let me know it will be really helpfull .
site : http://www.quikr.com
1. There is a first modal popup as soon as you go to that website some times it comes up sometimes it might not ,but it will surely comes when you run the code .
2. I am able to close it without any problem .
3.The next step is there is another modal popup that comes up this is were I am not able to bring the focus on and click the log in with face book.
could you please try and let me know which code works .
I did try using Actions and even enabling native elements in firefox that too dint work out .
let me know what works .
Thank you
lilly.k
Hi Mohit & Ashish,
I tried by copying it from the fourm it worked so thank you so much ,I appreciate your timely help .
Thank you
lilly.k
Hi Ashish,
I have a problem while compiling Ant I just need your help on this please . Please see the attached doc in which i have the error message.
Thank you
lilly.k
Hi Mohit,
I did fix the code and its working actually the few jars were on lib folder which Ant coudin't compile so I had to put them
together and it worked fine .Thank you so much.
Thank you
lilly.k