a non standard check box

24 views
Skip to first unread message

Eko Budiharto

unread,
Jan 19, 2018, 1:08:25 AM1/19/18
to Selenium Users
dear all,
I'd like to write a selenium automation, but I have a situation, the checkbox using non html standard check box. It is using div class with gif image for the checkbox. I attach the screenshots to show it.

When it is checked, the div will show <div class="x-grid3-check-col-on x-grid3-cc-ext-gen65">, but in uncheck condition, the div will show as <div class="x-grid3-check-col x-grid3-cc-ext-gen65">.

I found this link (https://stackoverflow.com/questions/32778172/how-can-i-check-a-checkbox-in-selenium-webdriver-with-java) relates to this, but I still confuse how to write in selenium to check and uncheck the checkbox.


please help



unchecked checkbox position.png
checked checkbox position.png

Nollaig

unread,
Jan 19, 2018, 9:25:14 PM1/19/18
to Selenium Users
OK so basically what they are saying here in the screen shot is:
- find the element by its selector in this case xpath
- then you are going to find the specific attribute of that element which is the class which turns out to be the check box - then you are providing the class for when it is either checked or not on the far right in red - comparing the actual with expected returning true = pass or false = fail

Note: Best to use a constant for the name of this selector - then simply append: .Click(); on the end and put the if statement below it and you have checked the box and performed your validation
Auto Generated Inline Image 1
Reply all
Reply to author
Forward
0 new messages