-1

first of all , You can check the video and see to which button I am trying to click. Here is the 15 sec Video: https://evrenos-hotmail.tinytake.com/sf/MTc4NTkzNV81ODM3MDA5

that button cannot be clickable by directly trying to click by Xpath:

WebElement button = driver.findElement(By.xpath(".//*[@id='DashboardContent']/div[2]/div/div/div[1]/div/div[4]/button"));
button.click();

Here is html part of the div:

<div class="col-md-6 col-xs-12 col-sm-6 u-height180 assessment-box assessment-box--orange u-mb15">
        <div class="bg-white u-rounded3">
            <div class="assessment-box__time c-greydark"><i class="icon_clock_alt"></i> ~ 5 min</div>
            <div class="alignment">
                <div>
                    <img src="https://supercv-stg.azureedge.net//Content/images/tests/page-personality.svg?1.0.0.12687" alt="" class="u-maxwidthfull">
                    <div class="assessment-box__label u-truncate">My Personality</div>
                    <div class="c-greydark u-font-style-italic u-truncate u-font-small u-lineheight1-2">Gain insight into your unique personality.</div>
                </div>
            </div>
            <div class="assessment-box__percentage" data-percentage="0" style="width: 0%;"></div>
            <div class="assessment-box__hover">
                <span class="lines"><span></span></span>
                <button onclick="continueToTest('/assessments/76/introduction', true)" s-analytics="get-started-assessments-for-personality">Get Started</button>
            </div>
        </div>
    </div>

Basically I want to click on "Get Started" button in here <button onclick="continueToTest('/assessments/76/introduction', true)" s-analytics="get-started-assessments-for-personality">Get Started</button> I also tried to click on frame first which activates the animation and makes to button visible , and then tried to click to the "getstarted" button, but did not work too.

WebElement button = driver.findElement(By.xpath(".//*[@id='DashboardContent']/div[2]/div/div/div[1]/div/div[4]/button"));
WebElement frame= driver.findElement(By.xpath(".//*[@id='DashboardContent']/div[2]/div/div/div[1]/div/div[4]"));
frame.click();     
Thread.sleep(1500);
button.click();

Note: the ones who wants to check the page in person can just create an account from supercareer.com & without verification , can go assessments (from left panel) check it out.

E.E
  • 9
  • 1
  • 8
  • 1
    Very little info in the question, and then asking for us to go register on some page. Please provide a good example of what you are trying to do, and what the problem is – vlatkozelka Jul 17 '17 at 12:35
  • What more you need to know? I can't click that button which becomes visible after an animation. I want to click on "Get Started" button with webdriver. – E.E Jul 17 '17 at 12:45
  • I also edited info but I am not sure how can I give more info about my question. If you want anything else to know I would be happy to provide. @vlatkozelka – E.E Jul 17 '17 at 12:54

1 Answers1

0

This button is available only after mouse over on the box. You can try the following, It may help you.

WebElement button = driver.findElement(By.xpath(".//*[@id='DashboardContent']/div[2]/div/div/div[1]/div/div[4]/button"));
WebElement frame= driver.findElement(By.xpath(".//*[@id='DashboardContent']/div[2]/div/div/div[1]/div"));
new Actions(driver).moveToElement(frame).click(button).perform();
Murthi
  • 5,299
  • 1
  • 10
  • 15
  • Thanks @Murthi , Your suggestion solved my problem. Actually , it makes the button visiable but for some reason , still not clicks. I have added one more button click after a little thread sleep. `WebElement button = CaseFunctions.driver.findElement(By.xpath(".//*[@id='DashboardContent']/div[2]/div/div/div[1]/div/div[4]/button")); WebElement frame= CaseFunctions.driver.findElement(By.xpath(".//*[@id='DashboardContent']/div[2]/div/div/div[1]/div")); new Actions(CaseFunctions.driver).moveToElement(frame).click(button).perform(); Thread.sleep(2000); button.click();` – E.E Jul 17 '17 at 14:54