How do I get the title of a link element when right clicking in firefox?
I can get the url using:
gContextMenu.linkURL
I have tried the following to get the value but it returns nothing.
gContextMenu.target.value
I can't see any other property that would help in the docs: http://developer.mozilla.org/en/XUL/PopupGuide/ContextMenus#Determining_what_was_Context_Clicked
of course it should be: gContextMenu.target.innerHTML as the a element has no value attribute.
"Bookmark This Link" uses gContextMenu.linkText()
Related
I am experimenting with AppiumLibrary in RobotFramework and have a simple test for a requirement that states: "the Set button should exist on this page.". I am testing this by retrieving the button that has a specified ID and then checking if that button has the right text.
I am able to retrieve the button I want via ID however am having trouble getting the actual text on the button.
Here is how the button is defined on the web page:
<button id="button-set" class="button ng-binding" style="width: 20%">Set</button>
Very simple! Using Appium Desktop in web/hybrid app mode and clicking on the Set button it says the "text" attribute shows "Set". However I've learned that using the attributes in Appium Desktop arent valid when searching for elements on a webpage, for example searching by the Class attribute in Appium Desktop (android.widget.Button) is not correct because on the web page the class for the button is instead: "button ng-binding".
I have tried the following:
# this retrieves the button fine, by ID
PAGE SHOULD CONTAIN ELEMENT xpath=//button[#id="button-set"]
# these all return 'None'
${name}= GET ELEMENT ATTRIBUTE xpath=//button[#id="button-set"] name
${text}= GET ELEMENT ATTRIBUTE xpath=//button[#id="button-Set"] text
So, I am unsure which Attribute to use to retrieve the text when retrieving element by ID. Instead, I have tried to retrieve the element this way:
# this also passes fine - I feel like I should also make sure this button has the correct ID, to make the mapping
# between test procedures and cases easier, but if this is as good as it gets then
# this can be argued for
PAGE SHOULD CONTAIN ELEMENT xpath=//button[contains(text(),'set')]
# however, the following does not make sense, this returns "button" instead of "button-set", which makes me think the xpath query is not correct
${id2}= GET ELEMENT ATTRIBUTE xpath=//button[contains(text(),'set')] id
# again, both of these return 'None'
${name2}= GET ELEMENT ATTRIBUTE xpath=//button[contains(text(),'set')] name
${text2}= GET ELEMENT ATTRIBUTE xpath=//button[contains(text(),'set')] text
I have also tried the following:
${element}= GET WEBELEMENT xpath=//button[#id="button-set"]
# this returns "button-set" as you'd expect:
${id3}= GET ELEMENT ATTRIBUTE ${element} id
# these again return 'None'
${name3}= GET ELEMENT ATTRIBUTE ${element} name
${text3}= GET ELEMENT ATTRIBUTE ${element} text
I feel like this should be a very simple thing to do, and can see in other questions that you would use the Name attribute when using pure Appium. However, using the Robot Framework library instead, that these doesn't appear to be the right approach. I must be doing something pretty simple wrong here, can anyone point it out?
Thank you!
Stumbling across the same issue when trying to fetch element's attributes via Get Element Attribute keyword. It seems that when fetching for the element's text, your best bet is to use Get Text keyword. Switching to Get Text keyword solved the problem on my case. Please see the links below for further details. Spoiler: there aren't any real explanations as to why the Get Element Attribute is flaky.
https://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html#Get%20Text
https://github.com/serhatbolsu/robotframework-appiumlibrary/issues/98
I get a value in a model, but how do I set that value as the selected value in an MVCxGridLookup control in jQuery? I am able to set it in PreRender() method for the control. But now I need to do it in jQuery.
Thanks.
I've found a solution !
$("#DropdownList").val('#Model.Name'); -->this is wrong.
This^ was what I was doing before, but it wont work. 'DropdownList' was the name I gave for the GridLookup control, but the id will vary from this, because this is a DevExpress control.
When we inspect the page elements (using developer tools or just right click and inspect element), the actual id it was assigned can be found.
$("#DropdownList_I").val('#Model.Name'); -->this solved the problem.
I am trying to click link in a row, which has another link that has name variable o.customer_id
Basically,I want to click a link "Action" which is in the same row as the link which has customer's id(which is variable)
I have tried using this but has not worked:
find(:xpath, link(have_content(o.customer_id)), :text => 'Action').click
Can someone please help?
Try adding parenthesis after the click to trigger it. I.e. click()
Also open the JavaScript console in your browser and make sure that find return a link element in your page.
I have a license number and I want to link to the specific results I get when that number is entered into the following form:
http://www.idfpr.com/LicenseLookUp/LicenseLookup.asp
However, the URL for the search results is always the same and not specific to the results (the URL is: http://www.idfpr.com/LicenseLookUp/results.asp).
Any ideas?
Use a debugger like firebug in firefox or the Google Chrome debugger. Inspect the form and set the method to 'get' instead of 'post' and click the button.
Now you can get something like this:
http://www.idfpr.com/LicenseLookUp/results.asp?TYPE=NAME&pro_cde=0219&lnme=wew&checkbox=on&finit=A&rowcount=1&submit1.x=42&submit1.y=8
I try opening a simple dialog from my iOS app to post something on a user's wall. However it seems the "name" parameter is completely ignored.
Here is the code, I use the Facebook SDK from Github, pulled the version yesterday.
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:#"This is the name",#"name",nil];
[facebook dialog:#"feed"
andParams:params
andDelegate:self];
The dialog shown only shows:
"Post to your wall"
"Write something..."
the text box
"via MyApp"
When actually posting the post is completely empty. Why is the "name" parameter completely ignored?
Seems I've found the solution. It works if you do not pass a description, but pass a caption argument instead. Then the name appears, the caption text below, and the parsed link text below that
For some background, the name parameter is attached to a link you attach to the post, see the properties description section https://developers.facebook.com/docs/reference/dialogs/feed/. So add a link parameter alongside the name.
As mentioned in a comment, even though the name parameter is not visible in the preview dialog it will be posted and show up on Facebook, providing you also provide a link parameter.