Hi guys I have the issue as a question that was answered called:
How do I select only visible elements using XPath?
The response was: //div[not(contains(#style,'display:none'))]//button[.='OK'].
My question is how do I adapt the above for aria-hidden='true', I'm trying to find elements that are only aria-hidden='false'?
I do apologize if my approach is messy, I'm kinda new to asking questions on here
Thanks
You can try adding another search criteria, depending on if the aria-hidden='false' applies to the div
//div[not(contains(#style,'display:none')) and #aria-hidden='true')]//button[.='OK']
or the button
//div[not(contains(#style,'display:none'))]//button[.='OK' and #aria-hidden='true']
There are some more examples here.
If I understand well, you could adapt with your example this way:
driver.find_element_by_xpath("//div[#aria-hidden='false']//button[.="OK"]")
Don't hesitate to share an URL or HTML code if my answer is not correct.
Finally with more than an hour of searching, trial and error, I found what I was looking for ^-^.. the pain
//a[contains(#aria-hidden, 'false') and contains(.,'text')]
Related
When a user inputs certain special characters i.e a html tag, the user receives this:
Error loading Partial View script (file: ~/Views/MacroPartials/ezSearch.cshtml)
I have been investigating and this seems to be a common issue and I attempted to apply a fix so it would strip out 'bad' characters:
public string CleanseSearchTerm(string input)
{
System.Text.RegularExpressions.Regex rgx = new System.Text.RegularExpressions.Regex("[^a-zA-Z0-9 -]");
input = rgx.Replace(input, "");
return input.ToString();
}
However, the issue is that this error is getting generated before it has a chance to hit my method to strip out 'bad' characters. Any ideas of how this can be resolved?
I haven't tried these changes myself Kyle but I have done some investigation to help you fix this problem. Could one of the following solutions help you?
See this Umbraco form question and its answers, especially the one from Ismail Mayat could help you.
Linked to Ismail's answer, there is also this "How to make the Lucene QueryParser more forgiving?" question and I'd recommend you to check the answers for this question, too.
Another answer that might help you is this stackoverflow answer.
Lucene.NET does contain a few classes to help with HTML stripping. These classes are located here in the Lucene.NET repo. Specifically, the HTMLStripCharFilter may be of interest.
In this question (https://stackoverflow.com/questions/15097501/can-uncrustify-be-prevented-from-modifying-certain-sections-of-code) i learned that i can use *INDENT-OFF* to exclude uncrustify action on certain parts of code.
Unfortunately i was not able to find this information anywhere else.
Does anybody know where i can look this up? Are there other comments which control uncrustifiy behaviour?
The *INDENT-ON* and *INDENT-OFF* are defined in the uncrustify_types.h file in the source code
See also Ben Gardner's comment: https://sourceforge.net/p/uncrustify/bugs/343/#0394
we're currently customizing iNotes for a customer (platform currently is Domino 9). We almost reached our goals, but one thing that's on our todo list I can't really figure out: they want us to also customize any possible error pages; see the following example screenshot:
This and other similar pages seem to come from the central Forms9.nsf which I'd love to leave as it is. We so far tried domcfg.nsf mappings, but as this is an iNotes internal error it obviously can't work; I also tried to figure out a way to put seomething into our customized Forms9_x.nsf but without any hint this is too abstract for me.
So my questions are:
has anyone ever done this?
what options do we have (apart from "hacking" Forms9.nsf)?
Many thanks in advance...
Update:
After continuing to play with domcfg mappings I suddenly saw a first result; not sure what's the difference to the first attempts, though; maybe moving the error form to Forms9_x.nsf did the trick? I'll keep investigating and post an answer if I can find one...
Alright, this has been an afternoon of wild guessing and hacking along, but finally I think I found it:
first of all, my playing around with domcfg mappings didn't have to do with solving the problem; instead, I just by chance had put my error page form into my Forms9_x.nsf and named it $$ReturnGeneralError (that's simply the name used in Forms9.nsf...; I completely had forgotton about those 4 pre-defined form names back from Domino 5 times).
What did not work was the old method of simply including a text file named MessageString to display the exact error message returned from the server; obviously iNotes is handling those error strings differently.
After a few hours of testing, and comparing codes between the standard iNotes error page and mine I finally found it: include some iNotes specific computed text into the page, in my case that is
#{{MessageString}; html}
See this document for some details (last row in the table)
Hopefully this can help someone else as well...
I want to register to a forum but stuck at a question to register.
Type the secuence
GDB123_YTU
I tried 1,2,3,4,5,6,7,8,9,10,21,321
What could it be?
Is this just a really badly implemented Captcha?
I read this as they want you to type "GDB123_YTU" in.?
Maybe you have to add 4? So "GDB1234YTU". Is this really a valid question for SO?
I was expecting something like WebElement.isfocus(),... something really simple, but the only approach I found is using the
:focus
pseudo class.
Is this really such an uncommon task as for not find tons of information?
I'm aware of this SO topic, but it's been almost two years from then. Nothing new in more recent versions?
Would you know some workaround?
There is another topic that covers this issue: Test if an element is focused using Selenium Webdriver
Basically the code will be
element.equals(driver.switchTo().activeElement());
for python developers:
def is_element_focus(id):
return self.driver.find_element_by_id(id) == self.driver.switch_to.active_element