webdriver is not able to click on a hyperlink in firefox

后端 未结 6 2143
不思量自难忘°
不思量自难忘° 2021-01-16 23:01
package testproject;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.         


        
6条回答
  •  半阙折子戏
    2021-01-16 23:56

    I have tested the below code,it clicks on GMAIL link on google page,if your question is solved then select as answer

    WebDriver driver= new FirefoxDriver();
    driver.get("https://www.google.co.in/");
    WebElement wb1= driver.findElement(By.xpath(".//*[@id='gb']/div[1]/div[1]/div[1]/div[2]/a"));
    wb1.click();
    

提交回复
热议问题