Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

Not able find xpath in user module for OrangeHRM

Open 1 Answers 21 Views
0 1
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;

public class test {
     public static WebDriver driver;
    public static void main(String[] args) throws InterruptedException {
        // TODO Auto-generated method stub
          String URL= "";
          driver= new FirefoxDriver();
          driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
         WebDriverWait wait= new WebDriverWait(driver,30);
         Actions act=new Actions(driver);
    WebElement e1=driver.findElement(By.xpath("//*[@id='menu_admin_viewAdminModule']/child::a/span[2]"));
/*JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("arguments[0].click();", e1);*/

commented by (202 points)
Is this the line where you are facing the issue?

commented by (12 points)
yes i am facing issue here
commented by (12 points)
i facing problem in finding xpath
commented by (151 points)
Kindly specify steps. I mean first, you logged in, then click where and how you reached above element?

1 Answer

It looks like your element is inside an iFrame. You should swith to an iFrame first.
answered by (202 points)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.