Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Actions in a new Browserwindow
#1
Solved: 11 Years, 4 Months ago
Hi,

i have problems with a new browserwindow which is opened during the test run.

If i only test the part with this window, everything works. No problem.
If i run the whole script, it sometimes happens that the script opens the new window, but then the script want to do the actions to the first window?!?

Example:
Code:
Browser("xyz").Page("xyz").WebEdit("signup").Set "iamatest"
Browser("xyz").Page("xyz").Link("tonewwindow").Click
Browser("new").Page("xyz2").Image("abc").Click
Browser("new").Page("xyz2").Image("abc2").Click
Browser("new").Page("xyz2").close

I tried to test with Browser("Title:=" & Titletext), but this only works with
Browser("Title:=" & Titletext).Close

Can someone help me?
Reply
#2
Solved: 11 Years, 4 Months ago
Multiple browser instances can be tested using the creationtime property of the browser. What you need to do here is......go the descriptive programming way or add another property to the new browser in the object repository......

the code should look something like this.....
Code:
Browser("name:=new","creationtime=1").Page("name:=xyz2").Image("name:=abc").Click
Browser("name:=new","creationtime=1").Page("name:=xyz2").Image("name:=abc2").Click
Browser("name:=new","creationtime=1").Page("name:=xyz2").close
this I hope should solve your problem......
Reply
#3
Solved: 11 Years, 4 Months ago
But If i record the following:

Code:
Browser("Google").Page("Google").Image("Google").Click

And i change it to:

Code:
Browser("Creationtime:=1").Page("Google").Image("Google").Click

I get following error:
The "Google" object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object.

Even if i add a new property named creationtime with value = 1

I didn't have to work with the OR until now... (mostly just recording)
How do I have to proceed in this example?
Reply
#4
Solved: 11 Years, 4 Months ago
If you start with DP, you have to stick with it on that line of code. So

Code:
Browser("Creationtime:=1").Page("Google").Image("Google").Click

should be

Code:
Browser("name:=Google","creationtime=1").Page("name:=Google").Image("name:=Google").Click

just like gammaflare suggested.
Reply
#5
Solved: 11 Years, 4 Months ago
And also please bear in mind.......

creationtime=0 for the first browser
creationtime=1 for the second browser
creationtime=2 for the third and so on.........
Reply
#6
Solved: 11 Years, 4 Months ago
If i use

Code:
Browser("name:=Google","creationtime=1").Page("Google").Image("Google").Click

following Run Error occurs:

Wrong amount of arguments or invalid property allocation: 'Browser'

If i try only

Code:
Browser("name:=Google").Page("Google").Image("Google").Click

then i get this:
The "Google" object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object.

What am I doing wrong?
Reply
#7
Solved: 11 Years, 4 Months ago
Try
Code:
Browser("CreationTime:=0").Page("micClass:=Page").Image("Google").Click
Reply
#8
Solved: 11 Years, 4 Months ago
Same problem, if i use following:

Code:
Browser("CreationTime:=0").Page("micClass:=Page").Image("Google").Click
i'll get the message:
The "Google" object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object.

As I understand, the tool is still not able to recognize the image "Google" via the creationtime of the browser.
But i don't know, how to handle this problem.
Reply
#9
Solved: 11 Years, 4 Months ago
Are there two browsers? If so change CreationTime to 1. Also try adding the image to the repository.
Reply
#10
Solved: 11 Years, 4 Months ago
No, at the moment there is only one browser window.
If i understand how it works, i'll test with a new opened browser window.
Up to then I can use Browser("CreationTime:=0").

The image is already in the repository.

After recording the repository looks like:

Test Objects
-Google (Browser)
--Google (Page)
---Google (Image)

And if i use the ("creationtime:=0") instead of ("Google"), the tool doesn't allocate the image to Browser("creationtime:=0"), although it should be the same. Or isn't it the same?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to call Actions from other Actions Naresh 1 7,982 09-25-2014, 10:26 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 3 Guest(s)