如何使用Node js Night Watch从父窗口导航到弹出窗口

时间:2016-06-02 12:02:40

标签: node.js nightwatch.js

我正在使用夜间监视在我的网站上实现facebook登录自动化。我成功地能够在弹出窗口中打开Facebook登录窗口,但无法通过夜间访问来访问弹出窗口

请帮帮我

1 个答案:

答案 0 :(得分:0)

我在测试中一直使用以下内容。您需要将焦点显式更改为脚本中的弹出窗口。

-include makefile.init

RM := rm -rf

PROG = HUGE_PROJECT_EXECUTABLE

MODULES := common comp_AAA comp_BBB pack_AAA pack_BBB pack_CCC
SRC_DIRS   := $(addprefix ../../,$(MODULES))
#BUILD_DIR := $(addprefix ../../build/,$(MODULES))

#Original non-recursive & working example
OBJS = $(patsubst %.cpp,%.o,$(wildcard ./src/*.cpp))
DEPS = $(patsubst %.cpp,%.d,$(wildcard ./src/*.cpp))

#bad attempt
#SRCS       := $(foreach sdir,$(SRC_DIRS),$(wildcard $(sdir)/*.cpp))
#OBJS       := $(patsubst %.cpp,%.o,$(SRCS))
#INCLUDES  := $(addprefix -I,$(SRC_DIR))


ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(DEPS)),)
-include $(DEPS)
endif
endif

-include makefile.defs

# All Target
all: $(PROG).tgz

$(PROG).tgz: $(PROG).mkefs $(PROG)
    @echo 'Building file: $@'
    @echo 'Invoking: Embeddable file system generator'
    mkefs -a -s -o"$@" -f"$<"
    @echo 'Finished building: $@'
    @echo ' '

$(PROG): $(OBJS) $(USER_OBJS)
    @echo 'Building target: $@'
    @echo 'Invoking: ELinOS C/C++ Linker'
    $(CXX)  -o "$(PROG)" $(SRCS) $(USER_OBJS) $(LIBS)
    @echo 'Finished building target: $@'
    @echo ' '

clean:
    -$(RM) $(OBJS) $(DEPS) $(PROG) $(PROG).tgz
    -@echo ' '

./src/%.o: ./src/%.cpp
    @echo 'Building file: $<'
    @echo 'Invoking: ELinOS C/C++ Compiler'
    $(CXX) -I./include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
    @echo 'Finished building: $<'
    @echo ' '

.PHONY: all clean dependents
.SECONDARY:

-include makefile.targets

要将焦点切换回原始窗口,您可以使用以下

.window_handles(function(result) {     // Since two windows are open we need    to get the window ids
    var temp = result.value[1];          //
    this.switchWindow(temp);             // and switch focus to the new window so that the next command is run against it
  })                                     //