Rselenium - Javascript/HTML - rselenium

Can anyone give me some advice by using FindElement to click some button in the website, which is under the Javascript function.
After<script type="text/javascript">, I couldn't select the id or name or
class underneath the <script type="text/javascript">. (It's like a drop down
list, which I want the remote desk can click it to enter next drop down list)
How can I >deal with this kind of subcategories?
THANK YOU SO MUCH!!

Related

Finding element in a dropdown list - Rselenium

I'm new to RSelenium working on a web-scraping project and need help in selecting a value from a drop down list. I've tried different ways including Xpath as the code below but failed all the times.
stateselect <- remDr$findElement(using = 'xpath', value = '//*[#id="state"]')
stateselect$clickElement()
Here is the url: https://www.cbd.gov.au/get-assessed/how/find-rated-building
I want to click to select a State (e.g., ACT) and click on Search button
Any advice or help would be useful and appreciated.
inspect page

Java FX database problem when adding new datas

I have a database problem. I want to create a simple Java FXML application which could help to my friend to search the protein/potassium content of the foods, because of kidney disease.
I have 4 class variables: name, protein, potassium, and id for the database (to identify the variables in the database).
I use Java DB - derby.
My application has 2 pane: 1. „home screen” has a textfield, where you have to type the name of the food you looking for, and if you click to the „search” button it will search the appropriate data from the database and show it in a table on the next pane. (the searching isn't working yet – you can type anything in the textfield what you want and then click to "Search", but no results showed yet in the table).
On the next page you can see the table, and at the bottom, you can add new data. I did a test to make sure the database works correctly, so the second pane I wrote a test Name, test Protein content, test Potassium content, and then click to the „add” button. Then the table shows just the potassium value, and puts this value in the first column instead of the „potassium column”. By the way, the db works but just stores the last value in the first column. I think I have a mistake somewhere in the setTableData method, but I run out of the ideas.
Here is my link to my files: https://github.com/Capkit/FirstProjects
I would be very grateful if somebody could help me!

A questionnaire page with multi select dropdownlist in MVC5

I'm new to MVC, This might be simple but I've looked everywhere for a solution and no luck. My problem is that I have a page that will contain many drop down lists of lines and not just one word. The user must select at least one line or more from each list. when they hit submit, all the selected items need to populate either on a pdf or a blank pop up as TXT. I've looked into enums, select2, chosen, Bootstrap select... the project I'm adding this page in is MVC5 code first approach with a database of users, the users function is to have roles assigned for different questionnaire. any help will be greatly appreciated. Thank you!

want to click on the particular link in selenium

suppose if you click on the contact us page ,in that page you want to click on the india in the list of the countries present in the contact us page.How we can write code for this in selenium
driver.findElement(By.id("contact us")).click();
driver.findElement(By.id("India")).click();
Here instead of Id use can use Xpath,Text,CSS also

New webpage needs to close previous page

I'm working with a hospital where we are implementing a web-application that is triggered from their own hospital information system (HIS).
The way the app works is that in their HIS, they select a patient and call the web-app with the patientId in the url.
Regarding patient safety, they want only one of those tabs open at the same time.
So if a second patient-tab is opened, the first one should be closed ..
Is this possible? And if it is, how?
Edit following danday74's answer
The url from the HIS is triggered via command line arguments (SAP system).
Firefox "http://url_to_webpage/"
when you link to the patient tab do this ...
<a ng-href="/your/patient/url" target="patientTab">open new patient tab</a>
When the link is clicked it should open the page in a new tab called "patientTab" - if another link is clicked with the target patientTab then it will use the existing "patientTab" - just make sure all your anchor tags that use the patientTab have the target set.
hope that does the job for you :)
So for the people that have a similar problem, the way we fixed it was the following:
On the init script for the page, we check if a session variable tab-token is found and if it contains a UUID
If the variable is not found, it means that no other open tab is found and we leave the tab active + create the variable and store a generated UUID in it
If a UUID is found, that means another tab is also active and we show a screen overlay with the message that another active tab was found
We watch on every change in the session variable and update the screen overlay whenever and wherever it needs to.
It is not a fool-proof solution, but in the context and usage of the application, it is sufficient ..

Resources