I want to know by doing inspect during OAS lpu test how can I find the answer of question. Under which tag it is available ???
I open the OAS lpu test , start the test , right click , go to inspect and click that . After this help answer ?
The answers will not be available to you, no matter how good of a sleuth you are.
If this website was made well, the answers to the test will not be stored on the front end of the page: they will only be on the webpage's back end, which is inaccessible to you as a user. It would be a major security flaw to have the answers for an online test stored in the front end code (which is the code that you can see if you "inspect" the page).
Related
I'm writing an automated test for a Web-based application that's coded in JavaScript and uses the Dojo framework. I can find the elements I want the bot to find in Developer Tools using well-defined XPATHS, but the automated test fails to find the text the XPATH leads to.
My test code looks something like this:
if verified:
verify_detail.set_pass()
else:
raise AssertionError("Cannot verify detail. Text did not match expected value.")
And the text I'm looking for on the UI isn't misspelled in the config file.
Anyone else have this problem? XPATH works in Developer Tools but fails when the test is run.
Edit 1:
I think I've found a clue as to what's causing this problem. The bot has to navigate to a panel called the details panel. The details panel, when opened, sits on top of another panel called the movie panel. Imagine a list of movie titles and the details panel is opened by right clicking the movie and selecting 'Details' from a dropdown.
So I've basically got a stack of panels, and my XPATH queries are hitting the pane beneath the details pane, which is where I really need to to look.
Has anyone else ever had this problem?
There is not much information to go on, but I realise that it is very hard to deliver a complete example for such cases.
The most common reason for this kind of behaviour is that the element in question is not present immediately on the page, but rather some JavaScript processing has to happen before it will appear.
The most common solution is using "implicit waits", see for example:
https://selenium-python.readthedocs.io/waits.html#implicit-waits
Be aware that this might affect performance of tests in other places, specifically when checking for absence of elements, if it is switched on constantly.
The obvious alternative is explicit waiting.
Another useful tool for analysing situations like this, is to set debugger breakpoints in the browser on DOM elements that you are interesting in, to see how the element is changing while the page is loading.
I've been trying to think of a better way to title this question, but unfortunately I have no idea how to explain it. Also I haven't found this on stack overflow (for the same reason stated above).
In Eclipse, I used to Ctrl+Click in the name of a method call (in java). And my cursor would jump in to the definition of my method function.
Question 1: Does anyone know the name of this behavior? I mean, maybe it's called function jumping or something like that.
Also I was searching for a plugin like this in Atom editor. Because I've tried to use this a lot of times (bad habits) and didn't work.
Question 2: Name of the plugin to do this in Atom?
Don't know if it helps, but I'm coding in JavaScript at the moment in Atom editor.
As the other answer noted, alt-click over a method/function name can jump you directly to where it was originally defined. It works within the same file, but it doesn't seem to work across files.
The closest Atom editor package I've found for javascript which allows you to jump to function/method definitions across files is called TernJS.
Once installed, you can use ctrl-shift-r over the word (function/method, variable etc) to bring up a list of where that method/function is defined (includes line # & filepath). You can then click on the list item & it will jump you to the definition.
Here is a video I made containing an example of using this atom package.
http://www.youtube.com/watch?v=cFAzqvYoHJs&t=11m58s
To answer your first question this 'behavior' is knows as 'go to definition', or 'jump to definition'.
To answer your second question some packages you could perhaps take a look at would be,
'goto-definition'
'code-peek'
I find these help a bit but still don't achieve the standards that I would fully like. I wanted something similar to the Intellij IDEA ctrl + click.
I find myself using the ctrl + shift + f to search the entire project for the related files of the thing I'm searching for. Then I find the particular file i'm looking for and shazam! I've got what I came to get. This particular method works best for me.
I know its not exactly what your looking for but this is the best thing I've found so far to achieve something similar to what we both seem to be looking for. Hope this helps a bit,
happy coding...
Currently this behavior is blocked by multiple cursors feature.
The closest you can get is "ctrl-alt-shift-d" + atom-ternjs
try atom/navigate
Link to Atom Navigate
It helps you to do this excact thing.
The only thing is that it's default key is f2 instead of cltr+click
But this is also editable in the package settings in de .atom file
I don't think I have a package for that.
Simply ctrl-D goes to definition for me.
Tried by luck after reading here other methods.
Cheers.
In Atom (1.57.0 version, os Ubuntu 18.04) command ctrl+shift+f is doing project-find:show. (try cmd+shift+f if on mac and the above does not work)
First select a function name in a file within a project, click ctrl+shift+f, and a list of files from your project folder, that also have this function (either defined, or used) should appear.
Click on any of these files, to come back to the list use ctrl+tab. I can see in key-bindings that this command project-find:show, is bound to ctrl+shift+f, and I have used it, but I am not sure if this is from one of the packages, or not. (sorry new to atom)
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I'm new at programming. I've done the HTML, CSS, website build and JAVASCRIPT courses on Codecademy. I've done some of the Eloquent Javascript and got a little lost in the sauce around chapter 5. I saw someone advise on here to take the JavascriptIsSexy route which I've been doing. I downloaded Notepad++ and have started going through "Beginning Javascript" book that is used in that "study guide". My problem is I cannot get anything, and I mean anything to run in a browser. IE, Firefox or Chrome. Even the simplest of things produce no output. The page loads either blank, or shows the first line of HTML and no more. Any blocks, functions and the like never run. White page. 1 or no lines. I've looked around for anyone having similar issues and haven't found it. Which makes me pretty sure I'm the problem here. I'd offer samples of code, but anything you can write in 60 would suffice as a good example. I am saving the files in a designated folder with the correct file types (.html or .js), closing all tags, etc.
Not exactly sure how to continue. I can't keep "practicing" if i cant get anything to run. I've tried using the RUN button in Notepad++ and selecting a browser. I've also tried opening a browser, choosing OPEN and selecting one of the files. I've even directly copied and pasted code right out of the book and tried to run it that way to make sure it isn't just a bug on my part. Same result.
I also tried writing and playing with codes in the "console" of IE and Chrome, but I can't get either of them to respond as I have no idea how to use them.
If this is a really dumb question or I haven't given you enough info to try and help me out, I apologize. I would appreciate any help you guys could throw out there.
Thanks.
First of all, you guys are awesome. I thought I'd be waiting for a couple days for some help. Seriously, that's cool. Here's a bit of code, one of the first examples the book has you run in a browser.
<html>
<body bgColor = "WHITE">
<p>Paragraph 1</p>
<script type="text/javascript">
alert("First Script Block");
</script7>
<p>Paragraph 2</p>
<script type="text/javascript">
document.bgColor ="RED";
alert("Second Script Block");
</script7>
<p>Paragraph 3</p>
</body>
</html>
Like I said. Very simple... I get nothing. Thanks again for the quick responses. You guys rock.
Open a new file in Notepad++ and add:
<!DOCTYPE HTML>
<html>
<body>
<script>
alert('This Should be a Popup Alert')
</script>
</body>
</html>
Save as test.html, make sure to save as "All Files".
Right click on the file, and open with any browser and should run in the browser just fine. Now just adapt the javascript you want to play with.
Not a dumb question at all. This is one of the most common things to try and get used to when you're starting out. So I'll ask you a question because this is the most common thing that newcomers forget - did you load all you files in to your index.html (or whatever your html file is name) file? If you're not sure, go to your website or page, and view source. Do a search for '.css'. If you can't find anything, you haven't loaded any stylesheets. Next do a search for 'script'. If you can't find that, you didn't include any javascript files. Is your site live? You need to FTP to it and upload the files to the server also. Here's a resource for importing your stylesheets and scripts into the DOM. http://webcomponents.org/articles/introduction-to-html-imports/ If you need help with FTP, let me know, I'd be glad to help, as I wish someone would have helped me when I was starting out.
If you are using console.log() to produce output, you won't see it in the browser's window that normally displays HTML. You need to look at the console. On Chrome it can be reached via the menu at View > Developer > Developer Tools.
Can you paste a code snippet in one of your index.html pages, you should try to learn and use xammp.
Install xammp
Once installed click the button "Start" on Apache
Move the project / website your doing into the following directory, make a folder name for it e.g. TestOne C:\xampp\htdocs
open Google Chrome or IE and put the following in the URL
localhost/TestOne/index.html
or whatever your index file of the website your making index.php etc..
You may need to run it on a server. You can make a local sever with tomcat. I hope this commit helps. You can always use a online website to emulate running it on your machine.
thanks,
adbadb25
When you are first learning how to code, I would start with a basic html format. Html,head, closing head,body, closing body,closing html. Inside the body tags, start with something simple. Opening and closing paragraphs tags. "Hello World".
This question already has answers here:
How to hide html source & disable right click and text copy?
(21 answers)
Closed 9 years ago.
I wonder how to hide the source code of a web page. This is an example of webpage with hidden source (right click -> view page source). Any ideas or suggestions?
UPDATE I fully agree, that fully hiding HTML source is impossible, otherwise the browser could't parse it. Using tools like FireBub etc. will show you the source. The interesting in the example above in that on "show source code" the displayed page does not match the output.
Now I understand it is just another kind of technology used here - XSLT.
Thanks for your replies!
If your page is generated dynamically (by Javascript), then it using View Source will not show anything (or very little, anyway). I suspect that's how your example is doing it.
Bear in mind that any page generated this way will still be visible by using a code inspector such as Firebug. So as #Brad M says, this will only stop people who don't really know what they're doing.
If you build the entire page in Java or Flash (or something similar like Silverlight I guess) then it's a lot harder for someone to find out what the source code is (though Java is pretty easy to decompile)
There is no way to hide your code from a client that must execute the code.
Your example just did some trick to prevent right-clicking and stuff. But eventually you can get your way around.
For interpreted language such as javascript, the following adage is true.
" Lock on the door is only for the one who don't care. If there comes thief, most of the time he is already prepared."
All you can do to prevent is obfuscating your code. That will prevent it for some time. But remember, if they are going to crack it, it is not unstoppable. The basic thing to remember is: your script is going to run on the client side and is "INTERPRETED" by browser. In these days, when there are few tools that can create source code from compiled file, the thought of hiding javascript code is even not thinkable. This How can I obfuscate (protect) JavaScript? can help you on how to do it.
I am using a Javascript accordion function which I found on the internet, however my Javascript skills are at a novice level ( Hence why I sourced a completed version to begin with).
What I have noticed is that when you load the page the accordion shows half initiated ( See Jsfiddle), what I would like to happen is that the accordion appears completely closed when the page is loaded.
I have put the accordion up on jsfiddle http://jsfiddle.net/richlewis14/uPvwL/, unfortunately the level of javascript used is beyond my capabilities and would appreciate any help in modifying it to my requirements, also if anyone could explain what is actually happening in the code I would appreciate that also, I would like to learn rather than jsut get the answer
Thanks
The script takes an argument to specify which element to open by default.
Change parentAccordion.init("acc","h3",0,0); to parentAccordion.init("acc","h3",0); and you're good to go :)
See http://jsfiddle.net/uPvwL/2/ for a working example.