Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
4 views
in DevOps and Agile by (19.7k points)

I am using atata framework with C#. I am trying to locate web element to select all rows but neither Id, CSS Path or XPath are able to find.

I have used ID, XPath and CSS Selector

[FindById("com.kronos.wfc.ngui.genies.selectall")]

public Button<_> SelectAllRows { get; private set; }

[FindByXPath("div[@id=com.kronos.wfc.ngui.genies.selectall]")]

public Button<_> SelectAllRows { get; private set; }

My page object should be located. Details of paths are:

Element:

<div class="widget-button btn-group margin-mini shrinkable" title="Select All Rows" 

id="com.kronos.wfc.ngui.genies.selectall" style="display: inline-block;">

<div class="top-bar"><span></span></div>

<button type="button" class="btn btn-rounded widget-button-icon" id="com.kronos.wfc.ngui.genies.selectall_btn">

<i class="icon-k-select-all"></i></button><div class="icon-label"><span>Select All Rows</span></div></div>

Selector: #com.kronos.wfc.ngui.genies.selectall

XPath: //*[@id="com.kronos.wfc.ngui.genies.selectall"]

1 Answer

+1 vote
by (62.9k points)
edited by
  1. Firstly correct your syntax error:

driver.findElement(By.id("diagnosisivd")).click();

 

2. If this is correct and still you are facing the same then try by adding some wait at some conditions.

WebDriverWait wait = new WebDriverWait(driver, 15); 

wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("diagnosisivd")));

 

3. Try with different locator type XPath/CSSSelector-

 By.xpath : //*[@id='diagnosisivd']

Wish to learn Angular and master it? Enroll in good quality Angular Training from Intellipaat, to get yourself practically skilled. 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...