htmlelements

C# selenium unable to locate button through xpath

半世苍凉 提交于 2021-02-16 21:18:06
问题 I'm trying to locate an element using XPath but my code is incorrect and I'm not sure of the write syntax. I entered the code below which isn't working. IWebElement customizeButton = driver.FindElement(By.XPath("//*[@id='container']/div/div[1]/div[1]/div[2]/button[2]")); The HTML code for the element is below <button class="button u-space-ls js-customize-button button--primary " data-tooltip="{"placement":"left","title":"Customize"}" data-reactid=".0.0.0.3.3"><span class="icon icon-gear" data

How received number in my textbox1 using windows form?

余生长醉 提交于 2019-12-25 05:45:48
问题 please see below html code in there I am want number in my textbox area. I am trying many process but still not getting any solution so please check html code with give me right solution. Number always going change when I am refresh page. Number not going change fully only last 7 digit going change but always show 206 first 3digit. If you have any good code then please share with me full details. I am new In the coding area so your help setting my many work. <table> <tr><td><b>Phone Number:<

Element + ID vs only ID in jquery?

梦想的初衷 提交于 2019-12-19 11:59:12
问题 div#some_id will scan through all the divs throughout the DOM. #some_id will pick up the ID directly from the DOM. So which is faster? $('div#some_id') or $('#some_id') ? 回答1: As ID are supposed to be unique in DOM, so div#some_id will be doing unnecessary scan on all DOM elements and #some_id will do a direct scan on it. You can also see the result here: div-some-id-vs-some-id 回答2: See Optimize Selectors: Beginning your selector with an ID is always best. and ID-only selections are handled

angular - access the element from ng-disabled

那年仲夏 提交于 2019-12-11 04:28:29
问题 I want to pass this (the element) - a button to my controller by ng-disable . here is my HTML : <button type ="button" class = "btn btn-default" ng-click= "open()" ng-disabled = "checkRowId(this)"> </button> And my controller : $scope.checkRowId = function(btn){ console.log(btn); //undefined } The log shoes undefined , is there a way to pass a element like a button via ng-disabled ? 回答1: There is no direct way to pass element via ng-disabled. You can create one directive say "disabled-ele"

Rotate all html element (whole page) 90 degree with CSS?

感情迁移 提交于 2019-12-09 15:59:28
问题 I want to display every thing in the page rotated consistently and dependently 90 degree, I tried to do it but the result was inaccurate and each element rotated independently. 回答1: So that was fun. Fiddle body{ margin:0; overflow:hidden; } .wrapper{ transform: rotate(90deg); transform-origin:bottom left; position:absolute; top: -100vw; left: 0; height:100vw; width:100vh; background-color:#000; color:#fff; overflow:auto; } <body> <div class='wrapper'> test<br /> <hr /> <div><hr /></div> <div>

HtmlElements finds 3 elements instead of only one in block when searching with XPath

ぃ、小莉子 提交于 2019-12-08 10:39:32
问题 I have a block: @Block(@FindBy(xpath = "//tr[contains(@class,'bg-success')]")) public class ShareContentRowBlock extends HtmlElement { @FindBy(xpath = "//h3[@class='fileName']/span/a") private TextBlock contentNameText; public String getContentName() { return contentNameText.getText(); } .... // some other elements and methods } I described a page: public class DocumentLibraryPage extends SitePage { private List<ShareContentRowBlock> shareContentRowBlocks; ..... public ShareContentRowBlock

Rotate all html element (whole page) 90 degree with CSS?

五迷三道 提交于 2019-12-04 04:53:26
I want to display every thing in the page rotated consistently and dependently 90 degree, I tried to do it but the result was inaccurate and each element rotated independently. So that was fun. Fiddle body{ margin:0; overflow:hidden; } .wrapper{ transform: rotate(90deg); transform-origin:bottom left; position:absolute; top: -100vw; left: 0; height:100vw; width:100vh; background-color:#000; color:#fff; overflow:auto; } <body> <div class='wrapper'> test<br /> <hr /> <div><hr /></div> <div><div><hr /></div></div> <div>ing</div> </div> </body> Had to wrap the content in a wrapper div, set body

Element + ID vs only ID in jquery?

天涯浪子 提交于 2019-12-01 14:00:46
div#some_id will scan through all the divs throughout the DOM. #some_id will pick up the ID directly from the DOM. So which is faster? $('div#some_id') or $('#some_id') ? As ID are supposed to be unique in DOM, so div#some_id will be doing unnecessary scan on all DOM elements and #some_id will do a direct scan on it. You can also see the result here: div-some-id-vs-some-id See Optimize Selectors : Beginning your selector with an ID is always best. and ID-only selections are handled using document.getElementById(), which is extremely fast because it is native to the browser. So the answer is: $

How can I get an HtmlElementCollection from a WPF WebBrowser

折月煮酒 提交于 2019-11-28 08:58:40
问题 My old WinForm application used HtmlElementCollection to process a page HtmlElementCollection hec = this.webbrowser.Document.GetElementsByTagName("input"); In WPF WebBrowser, there are several things that are different. For example this.webbrowser.Document does not have any method called GetElementsByTagName Therefore my code is unable to get an HtmlElementCollection 回答1: You need to add reference to Microsoft.mshtml and then you need to cast document as mshtml.HTMLDocument . After you do