xpath next button hidden - xpath

i am using xpath to go to the next page (for scraping)
but eventualy the "next" button hides how can i make sure that xpath doesnt select "next" again...
now its:
//A[.='Next']
the LI has the display none attribute
//LI[.='Next']
i tried
//LI[.='Next'][not(contains(#style,'display:none'))]//A[.='Next']
but it did'nt work...
whats the best way to solve this...

I fixed it with
//LI[not(contains(#style,'display: none'))]/A[.='Next']

Related

Ruby capybara autotests. It is not possible to click on certain button due that they all have same css

Page has multiple buttons.
I need to click first one, but they all have same class
one-employee__remove-btn
I could try xpath, but this kinda looks scary
/div[contains(#class,'one-employee__user')]/div/div/p[contains(.,'#{email}')]//div[contains(#class,'one-employee__user')]/div/div/p[contains(.,'terry#lind.co')]/../../../div[contains(#class, 'one-employee__remove-btn-cont')]/button
is there a possibility to make it happen using css?
full html for element
<button data-v-6454fca6="" title="Fjern" class="one-employee__remove-btn"></button>
If you're sure that it's always the first button you want to click, and assuming no other buttons on that page have the one-employee__remove-btn class you can try something like
all(".one-employee__remove-btn").first.click
Capybara supports first(".one-employee__remove-btn").click

How to click element on pseudo element ::after in Robot Framework

I would like to Click button at ::after but I don't know how to create xpath from pseudo element
I try this way //em[#class='x-btn-split']::after but it's not work.
Please anyone help.
You can use directly id='ext-gen33'. But if you want xpath only then include 2 attribute if there are many matching buttons
xpath = //button[#type='button' and #id='ext-gen33'].

XPath for "Onclick" attribute

I have to perform a click event on one of the option in a drop down menu on a web page, here is my absolute path for the element.
Absolute Path:-
And I have tried Xpath to find the element:-
All the combination of Xpaths that I tried are not working.
Please do suggest me if you have any solution for the same?
Many Thanks,
Shruti
Try with these Xpaths:
//a[#data-original-title='Excel']
//a[#alt='Excel']
//a[text()='Excel']

Robotframework xpath how to locate element

I want to click on this element:
<a id="welcome" class="panelTrigger" href="#">Welcome Admin</a>
but I am not able to locate this element.
I have tried:
id=welcome, xpath=//*[#id="welcome"]
Click Element or Click Link but it is not working. Can you please help me?
I think you should be fine any of the lines below:
Click Link id:welcome
Click Link Welcome Admin
Based on the documentation:
When using the default locator strategy, links are searched using
id, name, href and the link text.
So if the ID does not happens to be unique you can still refer to the link by its text.
Try this way
Scroll To Element xpath ${element_locator}
Wait Until Element Is Visible ${element_locator} timeout=30s
Click Element ${element_locator}

firebug: how to set watch when an <div id="abcd"> is changed by JS code?

I have a <div id="abcd"> which is changed by other code, I want to find out who is chaning that, can I set up a watch expression so that I can catch it in FireBug?
Thanks.
Bin
Using Firebug 1.5 or 1.6, use the Inspect to select the element, then in the HTML panel, right click on the element and select eg break on attribute change or another one as you need.
See http://getfirebug.com/doc/breakpoints/demo.html
i don't know the exact wording in english, i use it in german. But if you click right on your div, there is a function called "explore element" (normally at the bottom of the context menu). Afterwords firebug displays that area where you can see all live changes...

Resources