RE: Mouse over and click issue
Hi,
Unable to click on myprofile in myntra.com.
Steps: Login to myntra.com and mouse over my myntra and click my profile.
Note: I was unable to upload image, getting security issue.
- WebElement element = driver.findElement(By.linkText(“My Myntra”));
- Actions action = new Actions(driver);
- action.moveToElement(element).build().perform();
- driver.findElement(By.linkText(“View My Profile”)).click();
- Log.info(“Mouse-Overed On MyProfile and clicked on is View My Profile”);
- }catch (Exception e){
- Log.error(“==> Not Mouse-Overed On MyProfile and clicked on is View My Profile”);
- throw(e);
- }
I am Newbie here .. Wanted to try the answer for the question u asked..
Yes , by using linkTest its not working.
But using partialLinkTest its working.
WebElement element = driver.findElement(By.linkText(“My Myntra”));
Actions action = new Actions(driver);
action.moveToElement(element).build().perform();
Thread.sleep(3000);
WebElement element1 = driver.findElement(By.partialLinkText(“MY“));
or can use any name part —-WebElement element1 = driver.findElement(By.partialLinkText(“name part above VIEW MY PROFILE”));
action.moveToElement(element1).perform();
element1.click();
Can any1 else here let us know why linkTest not picking the exact words?
Rajesh,
Thanks to you, but it’s not working for me — Tested on FF and Chrome browsers.