Watir Tables that is also a link - watir

I want to get the text field "test" out of this web page. How do i do it? I started with:
e.form(:name => "MainForm").table(.
and i tired a few things to get it to work but I an stuck. If it is unclear to what i am asking, just show be how to set a variable to the word "test".
Thank you.

Depending on how you might expect the page to change over time, there are a variety of ways.
If it is always the first cell of the page with class 'cellnohilite', you could do:
value = browser.td(:class, 'cellnohilite').text
If it is always the first cell of that specific table, you could do:
value = browser.tbody(:class, 'blacklabel').td.text
If you know that the text of the cell is 'Test', you could even do:
value = browser.td(:text, 'Test').text

browser.frame(:name, "MainForm").td(:text, "Test").text
Good Luck!

Related

How to hide text in certain cells from a script?

Windows 10, Google Sheets, LVL: Rookie.
So I have a sheet, that is kinda like a scoreboard, the main purpose of it is to do scoreboard things, but that's irrelevant. Basically, for new people that use the sheet, I have green sentences near cells to show them what goes there, kinda like tutorials.
But, for people that have used the sheet for a while, they are going to get tired of all this extra space used up by green sentences that don't actually teach them anything cause they already know it.
SO I wanted to create a button from a UI box, that disables tutorials (Just hiding/deleting these green sentences), and whenever they wanted to see the tutorials "sentences" again, they could use another UI Button to enable them, which unhides/adds the text back in the cells.
I already have the UI Box setup...
The only thing I don't know how to do or what to code, is hiding/deleting these sentences, and being able to unhide/paste the sentences.
Now, if this can be done in an easy formula, please let me know, but otherwise, please help me write out a script for this. I will credit you if you wish.
You have a complicated spreadsheet that included about 25 text "hints" to user. You want experienced users to have the ability to "hide" the hints if they wish.
You could do this with a checkbox.
Untick (the default): the comments appear.
Tick the box: the comments are hidden
Create a checkbox (say, it is in Cell G1),
Edit all your hints along these lines.
=if($G$1=TRUE,"","Team name goes here --->")
Explanation
$G$1=TRUE`: this means that the check box has been ticked
if TRUE, then display nothing: ""
if not TRUE (the checkbox is NOT ticked), then display the hint. Such as "Team name goes here --->"

Selecting one value from the dropdown

I am trying to select a value from dropdown list but my script keep on failing. the value that i am selecting is from Excel document with the 'Manager' as the value.
here is my xparth
And Here is my console
i tried different solution but with no luck. the below code is the one i am trying that produced the error.
Select select = new Select(driver.findElement(By.xpath("//*[#id='main']/div/div[2]/form/div[2]/div[7]/div/div[1]/div[1]")));
select.deselectAll();
select.selectByVisibleText(AGR);
Will appreciate your help.
The code should be select.selectByVisisbleText("Manager"). Partial Text is not accepted.Complete text should be entered.
finally i found solution to my problem. all i had to do is to find the xPath and send keys from the excel doc and click enter on the keyboard. this means i can change the name that is on the dropdown on the excel document, rather than hard code it on code.
WebElement webElement = driver.findElement(By.xpath("//*[#id='main']/div/div[2]/form/div[2]/div[7]/div/div[1]/div[1]/input"));//You can use xpath, ID or name whatever you like
driver.findElement(By.xpath("//*[#id='main']/div/div[2]/form/div[2]/div[7]/div/div[1]/div[1]/input")).sendKeys(AGR);
webElement.sendKeys(Keys.ENTER);
hope my solution can help any one experiencing the same issue.

Drive spreadsheet, wrapping link

I'm trying to find a way to make Google Spreadsheet wrap a link, and showing the content in many lines, just like microsoft excel works:
I've found nothing so far on how to implement this, which should be used very often I believe.
Here's how the same excel works imported to Google Spreadsheet:
In the google spreadsheet I selected "Wrap text" but it only wraps it, hiding the overflow of it, however I can't see the whole link.
Any help is greately appreciated.
If you don't mind modifying the contents of the cell in order to display wrapped text, you could use an additional column with a formula like this to insert spaces after certain characters so that the url can wrap:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B1,"&","& "),"/","/ "),"?","? "),"#","# ")
You should keep the original URL around though, since the resulting value will no longer be a valid URL.
Google Spreadsheets only wraps text where there is white space or hyphens. It will not wrap in the middle of a word the way Excel does. There's no way around this I'm afraid.

Default look of editable table cells in JavaFX

I would like to have first column in my table editable. That works fine. However table looks normal and only when I click on the editable cell, it looks like input box. I would like to have this look of inputbox as default on every editable column in my table, so user knows right away which cell he is able to modify and which one he cannot. I figured I will have to modify caspian.css, but I couldn't find anything there. Is there easier, programmatic way to do this?
Thanks
You need to set the cellFactory of your column, inside it you can specify what you want by default on your cell by setting is graphics
explanation
and here

Getting Value Picker and HughesConnect Viewpicker combination in XPages

I have an application that uses the Ext Lib value picker from a view and it works but it is very cludgy. The reason is that there are over a thousand choices and the user has to scroll through them all to get to where he/she wants to go. I want to use the HughesConnect.com picklist CC, which is very nice. However, I am having trouble with a particular issue that is probably very simple but I can't figure it out.
I want to be able to use the HughesConnect.com picklist CC to grab one value at a time and put it into a field. Then, when the user clicks on the button again, I just want them to have the ability to grab a value and append it to the same field. Every time I run it now, it is just overwriting the field. I can't use Multi Value in the CC because the view has multi values in the column from the same document. I have found that if this is the case, it doesn't work. No matter what I try. I am not very good with arrays in XPages, so I am likely doing something wrong and to be honest, I don't even have any sample code because everything I have tried hasn't worked.
I am starting to wonder whether it's even possible but it sounds so simple that it must be.
The Value Picker allows you to add a search with a view data source. Is there a reason for not using that? I can't remember if search support multi-select. It may not.
If you want to use Mark's view picker, how about getting a bit creative. Push the value into a Hidden Input field that has an onChange event. In the onChange event, append the value to a different multi-value field. If you bind the Dojo List Text Box to your multi-value field, it will make it easier for users to deselect entries. It's a bit creative, but should produce exactly the result you're looking for.

Resources