hidden-field

Selenium Webdriver - click on hidden elements

馋奶兔 提交于 2019-11-26 20:22:14
I am trying to automate upload file functionality in Google Drive. The element used to pass parameters is hidden with height - 0px. None of the user actions would make this element visible. So I need a work around to click on the element while it is not visible. <input type="file" style="height: 0px; visibility: hidden; position: absolute; width: 340px; font-size: inherit;" multiple=""/> The xpath for the above element is - //*[@class='goog-menu goog-menu-vertical uploadmenu density-tiny']/input I am using WebDriver.findElement(By.xpath(<xpath>).sendKeys(<uploadFile>) Exception - org.openqa

Jquery Hidden Field

隐身守侯 提交于 2019-11-26 20:21:11
问题 Why can't I get the value of this hidden field? I have a control... <asp:HiddenField ID="HiddenFieldServerDateTime" runat="server" /> Which renders as... <input type="hidden" name="ctl00$cph_main$HiddenFieldServerDateTime" id="ctl00_cph_main_HiddenFieldServerDateTime" value="08/01/2010 10:54:11" Which I'm trying to get the value of using... var serverDateTime = $("#HiddenFieldServerDateTime").attr('value'); So what's wrong? I prefer this var dateTime = $("[id$=_HiddenFieldServerDateTime]")

@Html.HiddenFor does not work on Lists in ASP.NET MVC

最后都变了- 提交于 2019-11-26 18:42:47
I'm using a model that contains a List as a property. I'm populating this list with items i grab from SQL Server. I want the List to be hidden in the view and passed to the POST action. Later on i may want to add more items to this List with jQuery which makes an array unsuitable for expansion later on. Normally you would use @Html.HiddenFor(model => model.MyList) to accomplish this functionality, but for some reason the List in POST is always null. Very simple question, anyone know why MVC behaves like this? Daniel Mackay I've just come across this issue and solved it simply by doing the

How to type some text in hidden field in Selenium WebDriver using Java

拜拜、爱过 提交于 2019-11-26 17:46:55
问题 I am using WebDriver with Java for test automation. I have the following HTML code for input field which is hidden: <input type="hidden" value="" name="body" id=":6b"> How to type something in hidden field in Selenium2 (WebDriver)? I have written code as: driver.findElement(By.name("body")).sendKeys("test body"); But it was shown the following error: org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with Command duration or timeout:

HTML form with multiple hidden control elements of the same name

好久不见. 提交于 2019-11-26 08:56:26
问题 Is it legal to have an HTML form with more than one \"hidden\" control element with the same name? I expect to get the values of all of these elements at the server. If it is legal, do the major browsers implement the behavior correctly? 回答1: The browsers are OK with it. However, how the application library parses it may vary. Programs are supposed to group identically named items together. While the HTML specification doesn't explicitly say this, it is implicitly stated in the documentation

Selenium Webdriver - click on hidden elements

本小妞迷上赌 提交于 2019-11-26 07:34:21
问题 I am trying to automate upload file functionality in Google Drive. The element used to pass parameters is hidden with height - 0px. None of the user actions would make this element visible. So I need a work around to click on the element while it is not visible. <input type=\"file\" style=\"height: 0px; visibility: hidden; position: absolute; width: 340px; font-size: inherit;\" multiple=\"\"/> The xpath for the above element is - //*[@class=\'goog-menu goog-menu-vertical uploadmenu density

How to read text from hidden element with Selenium WebDriver?

ε祈祈猫儿з 提交于 2019-11-26 07:33:59
问题 I\'m trying to read the example String 1000 out of a hidden <div> like this: <div id=\"hidden_div\" style=\"visibility:hidden\">1000</div> I am aware that WebElement.getText() does not work on hidden elements in Selenium 2 (WebDriver), so I searched for solutions (like this one) and apparently the following code should work: WebElement hiddenDiv = seleniumDriver.findElement(By.id(\"hidden_div\")); String n = hiddenDiv.getText(); // does not work (returns \"\" as expected) String script = \

@Html.HiddenFor does not work on Lists in ASP.NET MVC

若如初见. 提交于 2019-11-26 06:06:14
问题 I\'m using a model that contains a List as a property. I\'m populating this list with items i grab from SQL Server. I want the List to be hidden in the view and passed to the POST action. Later on i may want to add more items to this List with jQuery which makes an array unsuitable for expansion later on. Normally you would use @Html.HiddenFor(model => model.MyList) to accomplish this functionality, but for some reason the List in POST is always null. Very simple question, anyone know why MVC