Unable to write test cases for hidden and read only elements in selenium 2 module

201 views
Skip to first unread message

Aaryan

unread,
Aug 24, 2013, 2:29:43 AM8/24/13
to seleniu...@googlegroups.com

Dear sir ,

I am writing acceptance tests using selenium 2 and codeception  . I am almost able to write test cases all the types ... except readonly , and hidden elements .. actually its very important from .. here i am facing mainly two issue .. please help ...

1.Unable to write test cases for elements declared as read only

see the following code .. actually i need to fill that field .. due to read only its not filled .. i need to alter this in code ..

2.Some elemnts by default hiddent ... on place of mouse (hover) those are visible like delete buttons .. etc .. after placing mouse only they are visible ..

.hidden {
display: none;
visibility: hidden;
}

.onhover > ul {
display: none;
}

Please suggest me how to write test cases for this read only and hidden elements .. Actually its very important for me

Santosh Vishwakarma

unread,
Aug 26, 2013, 8:40:05 AM8/26/13
to seleniu...@googlegroups.com
 IJavaScriptExecutor jsObject = (IJavaScriptExecutor)driver;

String js = "arguments[0].style.visibility='visible';";

jsObject.ExecuteScript(js, webElement);

Use this script before clicking on object.
Reply all
Reply to author
Forward
0 new messages