Phantoms Driver div tag

9 views
Skip to first unread message

Sriikandan Ramasamy

unread,
Aug 3, 2015, 1:23:08 PM8/3/15
to Selenium Users
Hi Members

I am trying to enter value in the text box but phantoms 2 is not working and below is the HTML code

<div class="xxx xx">

<div class="col-10">&nbsp;</div>
<input class="kpad-input" data-bet-id="1" data-has-balance="False" data-single-xx="1" data-val="true" data-val-number="The field UnitStake must be a number." data-val-required="The UnitStake field is required." id="UnitStake-1" name="xxx[0].xx" placeholder="Stake" type="text" value="" />


I tried all 
            ((IJavaScriptExecutor)driver).ExecuteScript("document.getElementById('UnitStake-1').setAttribute('value', '2' );");


But still it is passing the value but there is a javascript function while entering, it is not called

Kaleem Uddin Mohammed Abdul

unread,
Aug 4, 2015, 1:39:18 AM8/4/15
to Selenium Users
Looks like the Id is dynamic generated. I would suggest, find Id during debugging!
Reply all
Reply to author
Forward
0 new messages