How can I click a javascript button on VB.net - vb.net

I am using visual basic 12. There is a web browser in my form. I want to click it but i have a problem. The button is a javascript button. So this code doesn't work:
WebBrowser1.Document.All("button id").InvokeMember("click")
Here is the hmtl of button. How can i click it.
<p class="text-center panel-text" style="cursor: pointer;" data-bal-yenile="">32.06 KG BAL</p>

Related

How to click on button when <input type =Button> using Selenium

How to click on button when input type is button , I am using below code, click on button is not working?
<p>
<img class="getdata-button" style="float:right;" src="/common/images/btn-get-data.gif" id="get" onclick="document.getElementById('submitMe').click()">
<input type="button" value="Get Results" tabindex="9" id="submitMe" onclick="submitData();" style="display:none" ;="">
</p>
I have tried
driver.find_element_by_css_selector("input[#type='button']")).click()
driver.find_element_by_id("get").click()
driver.find_element_by_id("submitMe").click()
also used xpath for both still nothing
It can be done through JavaScript if that is acceptable for you:
driver.execute_script("document.getElementById('submitMe').click()")
The <img> element fires an onclick event: onclick="document.getElementById('submitMe').click()"; it locates and clicks the <input> element button below in the DOM. The Selenium click interaction can be skipped and call the same JavaScript from the <img> element which should get you the desired result.

Selenium selector for checkbox pseudo-element

<label class="casllic_text" for="Checkbox">
::before
<span>Blob <a class="button link" href="abc.pdf">Terms</a> </span></label>
I want to click on checkbox.
If I use label[for="Checkbox"] as selector, webdriver clicks on Terms link which opens PDF in another tab.
How can I click on checkbox which so far only gets identified if I hover on ::before. (Used inspect element to do that)

Unable to locate the element after clicking on toggle button

I am trying to automate the assignment for toggle button on the below link :
http://way2automation.com/way2auto_jquery/accordion.php
where the icons will go on and off based on the toggle button.
The HTML code snippet for the buttons are :
<h3 class="ui-accordion-header ui-state-default ui-accordion-icons ui-corner-all" role="tab" id="ui-id-1" aria-controls="ui-id-2" aria-selected="false" aria-expanded="false" tabindex="-1"><span class="ui-accordion-header-icon ui-icon ui-icon-circle-arrow-e"></span>Section 1</h3>
I have switched to the frame already and trying to check the element using :
chromeDriver.findElement(By.xpath("//*[#id=\"ui-id-1\"]/span")).isEnabled()
however after clicking on toggel buttons the icon gets disappeared and the element is not visible at all. Hence I am getting error for the above line. Is there any way to check the icons are there or not?

Looking to click a button to log in on an internet page using vba

I'm looking to click the "login" button on a webpage using vba. I have managed to automate everything else, from opening the webpage to inserting the username and password. Here is the html code of the login button:
<div id="dvButton" style="width: 80px; float: right;">
<input class="button" id="btnAction" type="button" value="Login">
</div>
i thought using iedoc.getelementbyId("btnAction").click would work, however nothing happens.
Thanks for the help

Customer dropdown click using Selenium

I have drop down which is basically a div that is displayed in a block, When I click on a button. Each value/item in a drop down is div. Dropdown value is something like this "Click to view report <img-help>". Now my question is when i try to open the drop down and click on a item, i see that sometime <img-help> is clicked and the test is failing as clicking on image will open a help window and it is not actually selecting the item in the dropdown. How can avoid this and just click on the text?
I basically click on the button and parse through the list and then click on the value that matches on what I want to click using Selenium Java api.
updating the code that i am trying to click I am trying to click "XXXXXXXYYYYYYXXXXXX" in the div. which will refresh the page with new data.
Also wanted to mention that I am doing this in IE7. Firefox seems to be working fine.
<div class="mstrListBlockItemSelected" title="Evaluate charges to identify potential for improvement.">
<div class="mstrListBlockItemName" style="padding-left: 25px;">
XXXXXXXYYYYYYXXXXXX
<span style="width: 4px;"/>
<img style="width: 16px; height: 16px; cursor: pointer;" alt="Help" src="../plugins/custom/images/help.gif"/>
</div>
</div>