Welcome to the Question and Answer site for Software Testing Professionals

You can get your queries resolved from Software Testing Professionals.

Ask a Question

Get answers and give answers to questions from other members.

View All Questions

Get votes and earn points to build your reputation in community.

View Hot Questions

Not able find xpath in user module for OrangeHRM

Open 1 Answers 20 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;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class test {
     public static WebDriver driver;
    public static void main(String[] args) throws InterruptedException {
        // TODO Auto-generated method stub
          String URL= "http://divyatad.trials621.orangehrmlive.com";
          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 (200 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 (192 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 (200 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.

We have resolved 1.2k+ Software Testing queries!

Software Testing Board Weekly update

We will send you handpicked questions that you would love to answer.

View previous campaigns.

Top Contributors